@merkl/api 0.18.1 → 0.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/dist/database/api/seeder/resources/protocol.d.ts +48 -48
  2. package/dist/src/backgroundJobs/index.js +8 -7
  3. package/dist/src/backgroundJobs/jobs/campaignsCacheUpdater.js +11 -11
  4. package/dist/src/backgroundJobs/jobs/health.js +1 -1
  5. package/dist/src/backgroundJobs/jobs/opportunityUpdater.js +2 -1
  6. package/dist/src/cache/index.js +2 -2
  7. package/dist/src/cache/redis.js +1 -1
  8. package/dist/src/eden/index.d.ts +1039 -944
  9. package/dist/src/entities/campaign.js +1 -1
  10. package/dist/src/factories/dynamicData/factory.d.ts +0 -0
  11. package/dist/src/factories/dynamicData/factory.js +10 -0
  12. package/dist/src/factories/{metadataFactory → opportunityMetadata}/factory.js +1 -1
  13. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Ajna.d.ts +2 -2
  14. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Ajna.js +3 -3
  15. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Ambiant.d.ts +1 -1
  16. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Ambiant.js +2 -2
  17. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Badger.d.ts +1 -1
  18. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Badger.js +3 -3
  19. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Clamm.d.ts +1 -1
  20. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Clamm.js +3 -3
  21. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Compound.d.ts +1 -1
  22. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Compound.js +2 -2
  23. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Default.d.ts +1 -1
  24. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Default.js +2 -2
  25. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Dolomite.d.ts +1 -1
  26. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Dolomite.js +2 -2
  27. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/EigenLayer.d.ts +1 -1
  28. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/EigenLayer.js +2 -2
  29. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Encompassing.d.ts +1 -1
  30. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Encompassing.js +3 -3
  31. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Erc20.d.ts +2 -2
  32. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Erc20.js +2 -2
  33. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Erc20Snapshot.d.ts +1 -1
  34. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Erc20Snapshot.js +2 -2
  35. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Euler.d.ts +1 -1
  36. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Euler.js +3 -3
  37. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/EventBased.d.ts +3 -3
  38. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/EventBased.js +5 -5
  39. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Hyperdrive.d.ts +1 -1
  40. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Hyperdrive.js +2 -2
  41. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Invalid.d.ts +1 -1
  42. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Invalid.js +2 -2
  43. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Ion.d.ts +1 -1
  44. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Ion.js +2 -2
  45. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/JsonAirdrop.d.ts +1 -1
  46. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/JsonAirdrop.js +3 -3
  47. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Morpho.d.ts +2 -2
  48. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Morpho.js +2 -2
  49. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Radiant.d.ts +1 -1
  50. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Radiant.js +2 -2
  51. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Silo.d.ts +1 -1
  52. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Silo.js +2 -2
  53. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/UniswapV4.d.ts +1 -1
  54. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/UniswapV4.js +2 -2
  55. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Vest.d.ts +1 -1
  56. package/dist/src/factories/{metadataFactory → opportunityMetadata}/implementations/Vest.js +3 -3
  57. package/dist/src/guards/BackOffice.guard.js +1 -1
  58. package/dist/src/guards/Engine.guard.js +1 -1
  59. package/dist/src/guards/TokenAuth.guard.js +1 -1
  60. package/dist/src/index.d.ts +212 -191
  61. package/dist/src/jobs/etl/dynamic-data.js +1 -1
  62. package/dist/src/jobs/etl/pendings.js +5 -4
  63. package/dist/src/jobs/etl/prices.js +3 -3
  64. package/dist/src/jobs/etl/reward-breakdowns.js +3 -3
  65. package/dist/src/jobs/etl/rewards.js +2 -2
  66. package/dist/src/jobs/etl/update-dynamic-data.js +4 -4
  67. package/dist/src/jobs/etl/update-euler-vaults.d.ts +1 -0
  68. package/dist/src/jobs/etl/update-euler-vaults.js +122 -0
  69. package/dist/src/libs/campaigns/campaignTypes/AjnaDynamicData.js +2 -2
  70. package/dist/src/libs/campaigns/campaignTypes/BadgerDynamicData.js +2 -2
  71. package/dist/src/libs/campaigns/campaignTypes/CLAMMDynamicData.js +2 -2
  72. package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +4 -4
  73. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/GenericProcessor.d.ts +1 -1
  74. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/GenericProcessor.js +4 -4
  75. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +1 -1
  76. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +1 -1
  77. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/AaveProcessor.d.ts +1 -1
  78. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/AaveProcessor.js +1 -1
  79. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/AnglesLiquid.d.ts +1 -1
  80. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/AnglesLiquid.js +1 -1
  81. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/AssetProcessor.d.ts +1 -1
  82. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/AssetProcessor.js +1 -1
  83. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/AuraProcessor.d.ts +1 -1
  84. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/AuraProcessor.js +3 -3
  85. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/BalancerGaugeProcessor.d.ts +1 -1
  86. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/BalancerGaugeProcessor.js +3 -3
  87. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/BalancerPoolProcessor.d.ts +1 -1
  88. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/BalancerPoolProcessor.js +3 -3
  89. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/BalancerV3PoolProcessor.d.ts +1 -1
  90. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/BalancerV3PoolProcessor.js +1 -1
  91. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/BeefyProcessor.d.ts +1 -1
  92. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/BeefyProcessor.js +1 -1
  93. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/CompoundProcessor.d.ts +1 -1
  94. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/CompoundProcessor.js +1 -1
  95. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/ERC4626Processor.d.ts +1 -1
  96. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/ERC4626Processor.js +1 -1
  97. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/EnzymeProcessor.d.ts +1 -1
  98. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/EnzymeProcessor.js +1 -1
  99. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/EqualizerGaugeProcessor.d.ts +1 -1
  100. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/EqualizerGaugeProcessor.js +1 -1
  101. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/EulerBorrowProcessor.d.ts +1 -1
  102. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/EulerBorrowProcessor.js +1 -1
  103. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/EulerLendProcessor.d.ts +1 -1
  104. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/EulerLendProcessor.js +1 -1
  105. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/FluidProcessor.d.ts +1 -1
  106. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/FluidProcessor.js +1 -1
  107. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/FraxProcessor.d.ts +1 -1
  108. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/FraxProcessor.js +1 -1
  109. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/GammaProcessor.d.ts +1 -1
  110. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/GammaProcessor.js +1 -1
  111. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/GearboxProcessor.d.ts +1 -1
  112. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/GearboxProcessor.js +1 -1
  113. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/HanjiVaultProcessor.d.ts +1 -1
  114. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/HanjiVaultProcessor.js +1 -1
  115. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/HoldStationProcessor.d.ts +1 -1
  116. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/HoldStationProcessor.js +1 -1
  117. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/HourglassProcessor.d.ts +1 -1
  118. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/HourglassProcessor.js +1 -1
  119. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/MaverickBPProcessor.d.ts +1 -1
  120. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/MaverickBPProcessor.js +2 -2
  121. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/MetamorphoProcessor.d.ts +1 -1
  122. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/MetamorphoProcessor.js +1 -1
  123. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/NoLinkVaultProcessor.d.ts +1 -1
  124. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/NoLinkVaultProcessor.js +1 -1
  125. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/PendleProcessor.d.ts +1 -1
  126. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/PendleProcessor.js +1 -1
  127. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/PendleYTProcessor.d.ts +1 -1
  128. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/PendleYTProcessor.js +1 -1
  129. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/RadiantProcessor.d.ts +1 -1
  130. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/RadiantProcessor.js +1 -1
  131. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/RfxProcessor.d.ts +1 -1
  132. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/RfxProcessor.js +2 -2
  133. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/Satlayer.d.ts +1 -1
  134. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/Satlayer.js +1 -1
  135. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/SpectraProcessor.d.ts +1 -1
  136. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/SpectraProcessor.js +2 -2
  137. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/SpectraYTProcessor.d.ts +1 -1
  138. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/SpectraYTProcessor.js +2 -2
  139. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/SpliceProcessor.d.ts +1 -1
  140. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/SturdySiloProcessor.d.ts +1 -1
  141. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/SturdySiloProcessor.js +1 -1
  142. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/TempestVaultProcessor.d.ts +1 -1
  143. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/TempestVaultProcessor.js +1 -1
  144. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/TemplateProcessor.d.ts +1 -1
  145. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/TorosProcessor.d.ts +1 -1
  146. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/TorosProcessor.js +1 -1
  147. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/UniswapProcessor.d.ts +1 -1
  148. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/UniswapProcessor.js +2 -2
  149. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/VicunaProcessor.d.ts +1 -1
  150. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/VicunaProcessor.js +1 -1
  151. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/WoofiProcessor.d.ts +1 -1
  152. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/WoofiProcessor.js +1 -1
  153. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/ZkSwapThreePoolProcessor.d.ts +1 -1
  154. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/ZkSwapThreePoolProcessor.js +1 -1
  155. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/curveNPoolProcessor.d.ts +1 -1
  156. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/curveNPoolProcessor.js +1 -1
  157. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/curveProcessor.d.ts +1 -1
  158. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/curveProcessor.js +1 -1
  159. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/stakedCurveProcessor.d.ts +1 -1
  160. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/stakedCurveProcessor.js +1 -1
  161. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/xU308Processor.d.ts +1 -1
  162. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/xU308Processor.js +1 -1
  163. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPrices.d.ts +1 -1
  164. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +1 -1
  165. package/dist/src/libs/campaigns/campaignTypes/EventBasedDynamicData.js +14 -17
  166. package/dist/src/libs/campaigns/campaignTypes/RadiantDynamicData.js +2 -2
  167. package/dist/src/libs/campaigns/campaignTypes/UniswapV4DynamicData.js +2 -2
  168. package/dist/src/libs/campaigns/campaignsDynamicData.js +1 -1
  169. package/dist/src/libs/campaigns/utils/fetchClamInfo.d.ts +1 -1
  170. package/dist/src/libs/campaigns/utils/fetchLogs.js +1 -1
  171. package/dist/src/libs/campaigns/utils/getCompV2ForksVaults.js +4 -4
  172. package/dist/src/libs/campaigns/utils/getContractCreationBlock.js +1 -1
  173. package/dist/src/libs/campaigns/utils/getDolomiteMarkets.js +1 -1
  174. package/dist/src/libs/campaigns/utils/getEulerV2Vaults.js +5 -5
  175. package/dist/src/libs/campaigns/utils/getUniswapV4Pools.js +4 -4
  176. package/dist/src/libs/deprecated-merklv3/index.d.ts +1 -1
  177. package/dist/src/libs/deprecated-merklv3/index.js +2 -2
  178. package/dist/src/libs/getTokensList.js +1 -1
  179. package/dist/src/libs/merklChainData.js +2 -2
  180. package/dist/src/libs/parse/marketsWithCache.js +2 -2
  181. package/dist/src/libs/positions/ajna/index.js +1 -1
  182. package/dist/src/libs/positions/badger/index.js +2 -2
  183. package/dist/src/libs/positions/clamm/index.js +3 -3
  184. package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.js +1 -1
  185. package/dist/src/libs/staticCampaigns.js +2 -2
  186. package/dist/src/libs/tokens/balances.js +1 -1
  187. package/dist/src/libs/tokens/tokenInfo.d.ts +1 -1
  188. package/dist/src/modules/v4/accounting/accounting.controller.js +3 -3
  189. package/dist/src/modules/v4/accounting/accounting.repository.d.ts +1 -1
  190. package/dist/src/modules/v4/accounting/accounting.repository.js +1 -1
  191. package/dist/src/modules/v4/accounting/accounting.service.d.ts +1 -1
  192. package/dist/src/modules/v4/accounting/accounting.service.js +2 -2
  193. package/dist/src/modules/v4/airflow/airflow.service.js +1 -1
  194. package/dist/src/modules/v4/apr/apr.model.d.ts +1 -1
  195. package/dist/src/modules/v4/apr/apr.model.js +1 -1
  196. package/dist/src/modules/v4/apr/apr.service.js +1 -1
  197. package/dist/src/modules/v4/blacklist/blacklist.controller.js +2 -2
  198. package/dist/src/modules/v4/blacklist/blacklist.repository.js +1 -1
  199. package/dist/src/modules/v4/boost/boost.controller.d.ts +1 -1
  200. package/dist/src/modules/v4/cache/cache.repository.js +1 -1
  201. package/dist/src/modules/v4/cache/cache.service.js +1 -1
  202. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +23 -23
  203. package/dist/src/modules/v4/campaign/campaign.controller.js +4 -4
  204. package/dist/src/modules/v4/campaign/campaign.model.d.ts +2 -2
  205. package/dist/src/modules/v4/campaign/campaign.model.js +2 -2
  206. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +60 -46
  207. package/dist/src/modules/v4/campaign/campaign.repository.js +6 -5
  208. package/dist/src/modules/v4/campaign/campaign.service.d.ts +69 -55
  209. package/dist/src/modules/v4/campaign/campaign.service.js +9 -9
  210. package/dist/src/modules/v4/chain/chain.controller.d.ts +10 -10
  211. package/dist/src/modules/v4/chain/chain.controller.js +1 -1
  212. package/dist/src/modules/v4/chain/chain.model.d.ts +1 -1
  213. package/dist/src/modules/v4/chain/chain.model.js +1 -1
  214. package/dist/src/modules/v4/chain/chain.repository.d.ts +11 -11
  215. package/dist/src/modules/v4/chain/chain.repository.js +1 -1
  216. package/dist/src/modules/v4/chain/chain.service.d.ts +10 -10
  217. package/dist/src/modules/v4/claims/claims.controller.js +1 -1
  218. package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +1 -1
  219. package/dist/src/modules/v4/computedValue/computedValue.controller.js +2 -2
  220. package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +1 -1
  221. package/dist/src/modules/v4/computedValue/computedValue.repository.js +1 -1
  222. package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +1 -1
  223. package/dist/src/modules/v4/computedValue/computedValue.service.js +1 -1
  224. package/dist/src/modules/v4/creator/creator.controller.d.ts +5 -5
  225. package/dist/src/modules/v4/creator/creator.controller.js +2 -2
  226. package/dist/src/modules/v4/creator/creator.model.d.ts +1 -1
  227. package/dist/src/modules/v4/creator/creator.repository.d.ts +5 -5
  228. package/dist/src/modules/v4/creator/creator.repository.js +1 -1
  229. package/dist/src/modules/v4/creator/creator.service.d.ts +4 -4
  230. package/dist/src/modules/v4/dynamicData/dynamicData.controller.js +1 -1
  231. package/dist/src/modules/v4/dynamicData/dynamicData.model.d.ts +1 -1
  232. package/dist/src/modules/v4/dynamicData/dynamicData.service.js +6 -7
  233. package/dist/src/modules/v4/enso/enso.model.d.ts +40 -40
  234. package/dist/src/modules/v4/enso/enso.service.d.ts +3 -3
  235. package/dist/src/modules/v4/enso/enso.service.js +2 -2
  236. package/dist/src/modules/v4/explorer/explorer.controller.d.ts +2 -2
  237. package/dist/src/modules/v4/explorer/explorer.controller.js +1 -1
  238. package/dist/src/modules/v4/explorer/explorer.model.js +1 -1
  239. package/dist/src/modules/v4/explorer/explorer.repository.d.ts +5 -5
  240. package/dist/src/modules/v4/explorer/explorer.repository.js +1 -1
  241. package/dist/src/modules/v4/explorer/explorer.service.d.ts +6 -6
  242. package/dist/src/modules/v4/interaction/interaction.controller.d.ts +1 -1
  243. package/dist/src/modules/v4/interaction/interaction.model.d.ts +2 -2
  244. package/dist/src/modules/v4/interaction/interaction.service.d.ts +1 -1
  245. package/dist/src/modules/v4/interaction/interaction.service.js +3 -3
  246. package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +22 -22
  247. package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +1 -1
  248. package/dist/src/modules/v4/kyberzap/kyberzap.service.js +1 -1
  249. package/dist/src/modules/v4/liquidity/implementations/BadgerPositionFetcher.js +1 -1
  250. package/dist/src/modules/v4/liquidity/implementations/ClammPositionFetcher.js +1 -1
  251. package/dist/src/modules/v4/liquidity/liquidity.controller.js +1 -1
  252. package/dist/src/modules/v4/liquidity/liquidity.service.js +1 -1
  253. package/dist/src/modules/v4/merklRoot/index.d.ts +3 -3
  254. package/dist/src/modules/v4/merklRoot/index.js +3 -3
  255. package/dist/src/modules/v4/merklRoot/merklRoot.controller.js +2 -2
  256. package/dist/src/modules/v4/merklRoot/merklRoot.repository.js +1 -1
  257. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +81 -81
  258. package/dist/src/modules/v4/opportunity/opportunity.controller.js +3 -3
  259. package/dist/src/modules/v4/opportunity/opportunity.converter.js +2 -2
  260. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +11 -11
  261. package/dist/src/modules/v4/opportunity/opportunity.model.js +7 -7
  262. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +128 -114
  263. package/dist/src/modules/v4/opportunity/opportunity.repository.js +13 -5
  264. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +106 -106
  265. package/dist/src/modules/v4/opportunity/opportunity.service.js +11 -11
  266. package/dist/src/modules/v4/opportunity/validate-id.pipe.js +1 -1
  267. package/dist/src/modules/v4/price/price.controller.d.ts +8 -8
  268. package/dist/src/modules/v4/price/price.controller.js +2 -2
  269. package/dist/src/modules/v4/price/price.model.js +1 -1
  270. package/dist/src/modules/v4/price/price.repository.d.ts +10 -10
  271. package/dist/src/modules/v4/price/price.repository.js +1 -1
  272. package/dist/src/modules/v4/price/price.service.d.ts +8 -8
  273. package/dist/src/modules/v4/price/price.service.js +3 -3
  274. package/dist/src/modules/v4/prisma/index.d.ts +1 -1
  275. package/dist/src/modules/v4/programPayload/programPayload.controller.js +2 -2
  276. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +209 -21
  277. package/dist/src/modules/v4/programPayload/programPayload.repository.js +120 -62
  278. package/dist/src/modules/v4/programPayload/programPayload.service.js +4 -2
  279. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +6 -6
  280. package/dist/src/modules/v4/protocol/protocol.controller.js +1 -1
  281. package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
  282. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +10 -10
  283. package/dist/src/modules/v4/protocol/protocol.repository.js +1 -1
  284. package/dist/src/modules/v4/protocol/protocol.service.d.ts +2 -2
  285. package/dist/src/modules/v4/protocol/protocol.service.js +3 -3
  286. package/dist/src/modules/v4/referral/referral.controller.js +1 -1
  287. package/dist/src/modules/v4/reward/index.d.ts +2 -2
  288. package/dist/src/modules/v4/reward/index.js +2 -2
  289. package/dist/src/modules/v4/reward/reward.controller.d.ts +1 -1
  290. package/dist/src/modules/v4/reward/reward.controller.js +6 -6
  291. package/dist/src/modules/v4/reward/reward.model.d.ts +1 -1
  292. package/dist/src/modules/v4/reward/reward.repository.d.ts +10 -10
  293. package/dist/src/modules/v4/reward/reward.repository.js +4 -4
  294. package/dist/src/modules/v4/reward/reward.service.d.ts +56 -56
  295. package/dist/src/modules/v4/reward/reward.service.js +5 -3
  296. package/dist/src/modules/v4/router.d.ts +202 -186
  297. package/dist/src/modules/v4/router.js +23 -23
  298. package/dist/src/modules/v4/status/status.controller.d.ts +4 -4
  299. package/dist/src/modules/v4/status/status.controller.js +3 -3
  300. package/dist/src/modules/v4/status/status.model.js +1 -1
  301. package/dist/src/modules/v4/status/status.repository.d.ts +11 -11
  302. package/dist/src/modules/v4/status/status.repository.js +1 -1
  303. package/dist/src/modules/v4/status/status.service.d.ts +6 -6
  304. package/dist/src/modules/v4/status/status.service.js +4 -4
  305. package/dist/src/modules/v4/token/token.controller.d.ts +31 -15
  306. package/dist/src/modules/v4/token/token.controller.js +4 -4
  307. package/dist/src/modules/v4/token/token.model.d.ts +5 -2
  308. package/dist/src/modules/v4/token/token.model.js +2 -1
  309. package/dist/src/modules/v4/token/token.repository.d.ts +3 -3
  310. package/dist/src/modules/v4/token/token.repository.js +3 -3
  311. package/dist/src/modules/v4/token/token.service.d.ts +24 -11
  312. package/dist/src/modules/v4/token/token.service.js +36 -15
  313. package/dist/src/modules/v4/tvl/tvl.model.d.ts +1 -1
  314. package/dist/src/modules/v4/tvl/tvl.model.js +1 -1
  315. package/dist/src/modules/v4/tvl/tvl.service.js +1 -1
  316. package/dist/src/modules/v4/uniswapV4/uniswapV4.service.js +3 -3
  317. package/dist/src/modules/v4/user/user.controller.d.ts +22 -22
  318. package/dist/src/modules/v4/user/user.controller.js +2 -2
  319. package/dist/src/modules/v4/user/user.model.d.ts +1 -1
  320. package/dist/src/modules/v4/user/user.model.js +1 -1
  321. package/dist/src/modules/v4/user/user.repository.js +1 -1
  322. package/dist/src/modules/v4/user/user.service.js +2 -2
  323. package/dist/src/plugins/error-handling.plugin.d.ts +1 -1
  324. package/dist/src/plugins/error-handling.plugin.js +2 -2
  325. package/dist/src/routes/v1/allowances.d.ts +2 -2
  326. package/dist/src/routes/v1/allowances.js +5 -5
  327. package/dist/src/routes/v1/balances.js +5 -5
  328. package/dist/src/routes/v1/prices.js +1 -1
  329. package/dist/src/routes/v1/tokens.js +1 -1
  330. package/dist/src/routes/v3/app.d.ts +7 -2
  331. package/dist/src/routes/v3/app.js +20 -10
  332. package/dist/src/routes/v3/blacklist.js +1 -1
  333. package/dist/src/routes/v3/campaign/delay.js +3 -3
  334. package/dist/src/routes/v3/campaignClaims.js +3 -3
  335. package/dist/src/routes/v3/campaignUnclaimed.js +1 -1
  336. package/dist/src/routes/v3/campaigns.js +6 -7
  337. package/dist/src/routes/v3/campaignsForMainParameter.js +2 -2
  338. package/dist/src/routes/v3/campaignsRewardsReport.d.ts +2 -2
  339. package/dist/src/routes/v3/campaignsRewardsReport.js +4 -6
  340. package/dist/src/routes/v3/compoundV2.js +1 -1
  341. package/dist/src/routes/v3/euler.js +1 -1
  342. package/dist/src/routes/v3/health.js +1 -1
  343. package/dist/src/routes/v3/lostyield.js +3 -3
  344. package/dist/src/routes/v3/merkl.js +1 -1
  345. package/dist/src/routes/v3/morphoMarkets.js +1 -1
  346. package/dist/src/routes/v3/morphoVaults.js +1 -1
  347. package/dist/src/routes/v3/multiChainPositions.js +1 -1
  348. package/dist/src/routes/v3/opportunity.d.ts +2 -2
  349. package/dist/src/routes/v3/opportunity.js +3 -4
  350. package/dist/src/routes/v3/overview.d.ts +2 -2
  351. package/dist/src/routes/v3/overview.js +2 -3
  352. package/dist/src/routes/v3/positions.d.ts +3 -4
  353. package/dist/src/routes/v3/positions.js +4 -5
  354. package/dist/src/routes/v3/radiant.js +1 -1
  355. package/dist/src/routes/v3/recipients.js +1 -1
  356. package/dist/src/routes/v3/rewards.js +2 -2
  357. package/dist/src/routes/v3/rewardsReport.js +1 -1
  358. package/dist/src/routes/v3/router.d.ts +11 -6
  359. package/dist/src/routes/v3/silo.js +1 -1
  360. package/dist/src/routes/v3/token.js +4 -4
  361. package/dist/src/routes/v3/twt/participants.js +55 -3
  362. package/dist/src/routes/v3/uniswapv4.js +1 -1
  363. package/dist/src/routes/v3/updates.js +2 -2
  364. package/dist/src/routes/v3/userRewards.js +5 -5
  365. package/dist/src/types/index.d.ts +0 -26
  366. package/dist/src/types/index.js +1 -6
  367. package/dist/src/utils/encodeCalls.d.ts +1 -1
  368. package/dist/src/utils/encodeCalls.js +1 -1
  369. package/dist/src/utils/error.d.ts +1 -1
  370. package/dist/src/utils/error.js +1 -1
  371. package/dist/src/utils/generateCardName.d.ts +1 -1
  372. package/dist/src/utils/generateCardName.js +1 -1
  373. package/dist/src/utils/generateIcons.d.ts +1 -1
  374. package/dist/src/utils/generateIcons.js +2 -2
  375. package/dist/src/utils/lastBlockBefore.js +2 -2
  376. package/dist/src/utils/pricer.js +1 -1
  377. package/dist/src/utils/prices/priceFetcherFactory.d.ts +1 -1
  378. package/dist/src/utils/prices/priceFetcherFactory.js +1 -1
  379. package/dist/src/utils/prices/priceService.js +2 -2
  380. package/dist/src/utils/prices/services/coinGeckoService.d.ts +1 -1
  381. package/dist/src/utils/prices/services/coinGeckoService.js +1 -1
  382. package/dist/src/utils/prices/services/defillamaService.d.ts +1 -1
  383. package/dist/src/utils/prices/services/defillamaService.js +1 -1
  384. package/dist/src/utils/prices/services/dexScreenerService.d.ts +1 -1
  385. package/dist/src/utils/prices/services/dexScreenerService.js +1 -1
  386. package/dist/src/utils/prices/services/erc4626Service.d.ts +1 -1
  387. package/dist/src/utils/prices/services/erc4626Service.js +2 -2
  388. package/dist/src/utils/prices/services/indexCoopService.d.ts +1 -1
  389. package/dist/src/utils/prices/services/indexCoopService.js +1 -1
  390. package/dist/src/utils/prices/services/priceFetcher.d.ts +1 -1
  391. package/dist/src/utils/prisma.d.ts +3 -3
  392. package/dist/src/utils/prisma.js +2 -2
  393. package/dist/src/utils/queries/activeCampaigns.d.ts +1 -1
  394. package/dist/src/utils/queries/activeCampaigns.js +1 -1
  395. package/dist/src/utils/queries/allCampaigns.d.ts +1 -1
  396. package/dist/src/utils/queries/allCampaigns.js +1 -1
  397. package/dist/tsconfig.package.tsbuildinfo +1 -1
  398. package/package.json +3 -2
  399. package/dist/src/libs/campaigns/getCampaigns.d.ts +0 -1
  400. package/dist/src/libs/campaigns/getCampaigns.js +0 -18
  401. package/dist/src/libs/custom/twtParticipants.d.ts +0 -6
  402. package/dist/src/libs/custom/twtParticipants.js +0 -54
  403. package/dist/src/modules/v4/programPayload/index.d.ts +0 -3
  404. package/dist/src/modules/v4/programPayload/index.js +0 -3
  405. package/dist/src/plugins/logger.plugin.d.ts +0 -22
  406. package/dist/src/plugins/logger.plugin.js +0 -3
  407. package/dist/src/types/parameters/Action.d.ts +0 -4
  408. package/dist/src/types/parameters/Action.js +0 -11
  409. package/dist/src/types/parameters/Chain.d.ts +0 -4
  410. package/dist/src/types/parameters/Chain.js +0 -13
  411. package/dist/src/types/parameters/ChainCampaignId.d.ts +0 -4
  412. package/dist/src/types/parameters/ChainCampaignId.js +0 -13
  413. package/dist/src/types/parameters/MainParameter.d.ts +0 -4
  414. package/dist/src/types/parameters/MainParameter.js +0 -19
  415. package/dist/src/types/parameters/OpportunityId.d.ts +0 -4
  416. package/dist/src/types/parameters/OpportunityId.js +0 -14
  417. package/dist/src/types/parameters/Timestamp.d.ts +0 -4
  418. package/dist/src/types/parameters/Timestamp.js +0 -16
  419. package/dist/src/types/parameters/Type.d.ts +0 -4
  420. package/dist/src/types/parameters/Type.js +0 -15
  421. package/dist/src/types/parameters/index.d.ts +0 -36
  422. package/dist/src/types/parameters/index.js +0 -17
  423. /package/dist/src/factories/{metadataFactory → opportunityMetadata}/factory.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { getClamsInfo } from "../../libs/deprecated-merklv3";
1
+ import { getClamsInfo } from "@/libs/deprecated-merklv3";
2
2
  import { AMM, ChainId, isSupportedChain } from "@sdk";
3
3
  import { t } from "elysia";
4
4
  import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
@@ -1,4 +1,4 @@
1
- import { getMorphoMarketsWithCache } from "../../libs/parse/marketsWithCache";
1
+ import { getMorphoMarketsWithCache } from "@/libs/parse/marketsWithCache";
2
2
  import { MorphoSubCampaignType } from "@sdk";
3
3
  import { t } from "elysia";
4
4
  export const query = t.Object({
@@ -1,4 +1,4 @@
1
- import { getMorphoMarketsWithCache } from "../../libs/parse/marketsWithCache";
1
+ import { getMorphoMarketsWithCache } from "@/libs/parse/marketsWithCache";
2
2
  import { MorphoSubCampaignType } from "@sdk";
3
3
  import { t } from "elysia";
4
4
  export const query = t.Object({
@@ -1,4 +1,4 @@
1
- import { Redis } from "../../cache";
1
+ import { Redis } from "@/cache";
2
2
  import { ChainId, isSupportedChain } from "@sdk";
3
3
  import { t } from "elysia";
4
4
  import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
@@ -5,7 +5,7 @@ export declare const query: import("@sinclair/typebox").TObject<{
5
5
  mainParameter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
6
6
  chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
7
7
  type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
8
- action: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<import("elysia").TSchema[]>>;
8
+ action: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
9
9
  tag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
10
10
  }>;
11
11
  declare const _default: (app: Elysia) => Elysia<"", false, {
@@ -29,7 +29,7 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
29
29
  type?: number | undefined;
30
30
  tag?: string | undefined;
31
31
  chainId?: number | undefined;
32
- action?: undefined;
32
+ action?: string | undefined;
33
33
  campaigns?: boolean | undefined;
34
34
  mainParameter?: string | undefined;
35
35
  testTokens?: boolean | undefined;
@@ -1,13 +1,12 @@
1
- import { OpportunityConvertorService } from "../../modules/v4/opportunity/opportunity.converter";
1
+ import { OpportunityConvertorService } from "@/modules/v4/opportunity/opportunity.converter";
2
2
  import { t } from "elysia";
3
- import param from "../../types/parameters";
4
3
  export const query = t.Object({
5
4
  campaigns: t.Optional(t.Boolean()),
6
5
  testTokens: t.Optional(t.Boolean()),
7
- mainParameter: t.Optional(param.MainParameter.type),
6
+ mainParameter: t.Optional(t.String()),
8
7
  chainId: t.Optional(t.Numeric()),
9
8
  type: t.Optional(t.Numeric()),
10
- action: t.Optional(param.Action.type),
9
+ action: t.Optional(t.String()),
11
10
  tag: t.Optional(t.String()),
12
11
  });
13
12
  export default (app) => {
@@ -1,6 +1,6 @@
1
1
  import { type Elysia } from "elysia";
2
2
  export declare const query: import("@sinclair/typebox").TObject<{
3
- chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<import("elysia").TSchema[]>>;
3
+ chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
4
4
  }>;
5
5
  export declare const response: import("@sinclair/typebox").TObject<{
6
6
  disputes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
@@ -40,7 +40,7 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
40
40
  body: unknown;
41
41
  params: {};
42
42
  query: {
43
- chainId?: undefined;
43
+ chainId?: number | undefined;
44
44
  };
45
45
  headers: unknown;
46
46
  response: {
@@ -1,4 +1,3 @@
1
- import param from "../../types/parameters";
2
1
  import { ANGLE_NETWORKS } from "@sdk";
3
2
  import { withTimeout } from "@sdk";
4
3
  import { t } from "elysia";
@@ -6,7 +5,7 @@ import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
6
5
  import { merklChainDataWithCache } from "../../libs/merklChainData";
7
6
  import { log } from "../../utils/logger";
8
7
  export const query = t.Object({
9
- chainId: t.Optional(param.Chain.type),
8
+ chainId: t.Optional(t.Numeric()),
10
9
  });
11
10
  export const response = t.Object({
12
11
  disputes: t.Record(t.String({ title: "ChainId" }), t.Object({
@@ -66,7 +65,7 @@ export default (app) => app.use(checkQueryChainIdValidity()).get("/overview", as
66
65
  return result;
67
66
  }, {
68
67
  transform({ query }) {
69
- query.chainId = !query.chainId ? undefined : Number.parseInt(query.chainId);
68
+ query.chainId = !query.chainId ? undefined : query.chainId;
70
69
  },
71
70
  query,
72
71
  tags: ["Merkl"],
@@ -1,10 +1,9 @@
1
1
  import type Elysia from "elysia";
2
- import { type TSchema } from "elysia";
3
2
  export declare const query: import("@sinclair/typebox").TObject<{
4
- chainId: import("@sinclair/typebox").TUnion<TSchema[]>;
3
+ chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
5
4
  user: import("@sinclair/typebox").TString;
6
5
  }>;
7
- export declare const response: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TTemplateLiteral<[import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<any>[]>, import("@sinclair/typebox").TLiteral<"_">, import("@sinclair/typebox").TString]>, import("@sinclair/typebox").TObject<{
6
+ export declare const response: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TTemplateLiteral<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TLiteral<"_">, import("@sinclair/typebox").TString]>, import("@sinclair/typebox").TObject<{
8
7
  userPositions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<(import("@sinclair/typebox").TObject<{
9
8
  almAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
10
9
  id: import("@sinclair/typebox").TString;
@@ -41,7 +40,7 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
41
40
  body: unknown;
42
41
  params: {};
43
42
  query: {
44
- chainId: never;
43
+ chainId?: number | undefined;
45
44
  user: string;
46
45
  };
47
46
  headers: unknown;
@@ -1,5 +1,4 @@
1
- import { Redis } from "../../cache";
2
- import param from "../../types/parameters";
1
+ import { Redis } from "@/cache";
3
2
  import { Campaign } from "@sdk";
4
3
  import { t } from "elysia";
5
4
  import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
@@ -7,7 +6,7 @@ import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
7
6
  import { getUserPositionsV2 } from "../../libs/positions";
8
7
  import { prepareFetch } from "../../libs/positions/prepareFetch";
9
8
  export const query = t.Object({
10
- chainId: param.Chain.type,
9
+ chainId: t.Optional(t.Numeric()),
11
10
  user: t.String(),
12
11
  });
13
12
  const positions = {
@@ -30,7 +29,7 @@ const positions = {
30
29
  balance: t.Number(),
31
30
  }),
32
31
  };
33
- export const response = t.Record(t.TemplateLiteral([param.Type.type, t.Literal("_"), t.String()]), t.Object({
32
+ export const response = t.Record(t.TemplateLiteral([t.Numeric(), t.Literal("_"), t.String()]), t.Object({
34
33
  userPositions: t.Array(t.Union(Object.values(positions))),
35
34
  }));
36
35
  export default (app) => app
@@ -55,7 +54,7 @@ export default (app) => app
55
54
  return await getUserPositionsV2(positionsToCheck, chainId, user);
56
55
  }, {
57
56
  transform({ query }) {
58
- query.chainId = !query.chainId ? undefined : Number.parseInt(query.chainId);
57
+ query.chainId = !query.chainId ? undefined : query.chainId;
59
58
  },
60
59
  query,
61
60
  tags: ["Merkl"],
@@ -1,4 +1,4 @@
1
- import { getRadiantMarketsWithCache } from "../../libs/parse/marketsWithCache";
1
+ import { getRadiantMarketsWithCache } from "@/libs/parse/marketsWithCache";
2
2
  import { t } from "elysia";
3
3
  export const query = t.Object({
4
4
  poolAddressProvider: t.String(),
@@ -1,4 +1,4 @@
1
- import { RewardService } from "../../modules/v4/reward";
1
+ import { RewardService } from "@/modules/v4/reward";
2
2
  import { t } from "elysia";
3
3
  import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { RewardService } from "../../modules/v4/reward";
2
- import { RewardConvertorService } from "../../modules/v4/reward/reward.converter";
1
+ import { RewardService } from "@/modules/v4/reward";
2
+ import { RewardConvertorService } from "@/modules/v4/reward/reward.converter";
3
3
  import { ChainId, isSupportedChain } from "@sdk";
4
4
  import { t } from "elysia";
5
5
  import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
@@ -1,4 +1,4 @@
1
- import { RewardService } from "../../modules/v4/reward";
1
+ import { RewardService } from "@/modules/v4/reward";
2
2
  import { t } from "elysia";
3
3
  import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
4
4
  import { InvalidParameter } from "../../utils/error";
@@ -20,8 +20,13 @@ export declare const v3: Elysia<"/v3", false, {
20
20
  query: {};
21
21
  headers: unknown;
22
22
  response: {
23
- [x: string]: any;
24
- 200: any;
23
+ 200: {
24
+ tokens: any;
25
+ prices: {
26
+ rate: number;
27
+ token: string;
28
+ }[];
29
+ };
25
30
  };
26
31
  };
27
32
  };
@@ -117,7 +122,7 @@ export declare const v3: Elysia<"/v3", false, {
117
122
  query: {
118
123
  from?: number | undefined;
119
124
  to?: number | undefined;
120
- chain_campaignIds: never[];
125
+ chain_campaignIds: string[];
121
126
  };
122
127
  headers: unknown;
123
128
  response: {
@@ -387,7 +392,7 @@ export declare const v3: Elysia<"/v3", false, {
387
392
  type?: number | undefined;
388
393
  tag?: string | undefined;
389
394
  chainId?: number | undefined;
390
- action?: undefined;
395
+ action?: string | undefined;
391
396
  campaigns?: boolean | undefined;
392
397
  mainParameter?: string | undefined;
393
398
  testTokens?: boolean | undefined;
@@ -406,7 +411,7 @@ export declare const v3: Elysia<"/v3", false, {
406
411
  body: unknown;
407
412
  params: {};
408
413
  query: {
409
- chainId?: undefined;
414
+ chainId?: number | undefined;
410
415
  };
411
416
  headers: unknown;
412
417
  response: {
@@ -511,7 +516,7 @@ export declare const v3: Elysia<"/v3", false, {
511
516
  body: unknown;
512
517
  params: {};
513
518
  query: {
514
- chainId: never;
519
+ chainId?: number | undefined;
515
520
  user: string;
516
521
  };
517
522
  headers: unknown;
@@ -1,4 +1,4 @@
1
- import { getSiloMarketsWithCache } from "../../libs/parse/marketsWithCache";
1
+ import { getSiloMarketsWithCache } from "@/libs/parse/marketsWithCache";
2
2
  import { t } from "elysia";
3
3
  export const query = t.Object({
4
4
  repository: t.String(),
@@ -1,7 +1,7 @@
1
- import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
2
- import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
3
- import { getTokenInfo } from "../../libs/tokens/tokenInfo";
4
- import { executeSimple } from "../../utils/execute";
1
+ import checkQueryAddressValidity from "@/hooks/checkQueryAddressValidity";
2
+ import checkQueryChainIdValidity from "@/hooks/checkQueryChainIdValidity";
3
+ import { getTokenInfo } from "@/libs/tokens/tokenInfo";
4
+ import { executeSimple } from "@/utils/execute";
5
5
  import { t } from "elysia";
6
6
  export const query = t.Object({
7
7
  chainId: t.Numeric(),
@@ -1,11 +1,63 @@
1
+ import { Redis } from "@/cache";
2
+ import { batchMulticallCallWithRetry } from "@/utils/generic";
3
+ import { log } from "@/utils/logger";
4
+ import { Interface } from "@ethersproject/abi";
5
+ import { BN2Number, ChainId, ERC20Interface } from "@sdk";
1
6
  import { t } from "elysia";
2
- import { getTwtParticipantsWithCache } from "../../../libs/custom/twtParticipants";
7
+ const stTwtABI = [
8
+ {
9
+ constant: true,
10
+ inputs: [],
11
+ name: "participantNumber",
12
+ outputs: [
13
+ {
14
+ name: "",
15
+ type: "uint256",
16
+ },
17
+ ],
18
+ payable: false,
19
+ stateMutability: "view",
20
+ type: "function",
21
+ },
22
+ ];
23
+ const stTwtAddresses = {
24
+ [ChainId.BSC]: "0x5029f49585D57ed770D2194841B5A0bE06BFc2ED",
25
+ };
26
+ const stTwtInterface = new Interface(stTwtABI);
27
+ async function getTwtParticipants(chainId) {
28
+ const tokenAddress = stTwtAddresses[chainId];
29
+ const calls = [
30
+ {
31
+ allowFailure: true,
32
+ callData: stTwtInterface.encodeFunctionData("participantNumber", []),
33
+ target: tokenAddress,
34
+ },
35
+ {
36
+ allowFailure: true,
37
+ callData: ERC20Interface.encodeFunctionData("totalSupply"),
38
+ target: tokenAddress,
39
+ },
40
+ ];
41
+ const result = await batchMulticallCallWithRetry(chainId, { calls });
42
+ const res = {
43
+ participants: 0,
44
+ totalSupply: 0,
45
+ };
46
+ try {
47
+ res.participants = stTwtInterface.decodeFunctionResult("participantNumber", result[0].returnData)[0].toNumber();
48
+ res.totalSupply = BN2Number(ERC20Interface.decodeFunctionResult("totalSupply", result[1].returnData)[0], 18);
49
+ }
50
+ catch (_error) {
51
+ log.local(`❌ Failed to call participantNumber for ${tokenAddress} on ${chainId}`);
52
+ }
53
+ return res;
54
+ }
3
55
  export const query = t.Object({
4
56
  chainId: t.Numeric(),
5
57
  });
6
- export default (app) => app.get("", async ({ query, set }) => {
58
+ export default (app) => app.get("", async ({ query }) => {
7
59
  const chainId = query.chainId;
8
- return await getTwtParticipantsWithCache(chainId);
60
+ return await Redis.getOrSet(`TwtParticipants_${chainId}`, getTwtParticipants, chainId);
9
61
  }, {
10
62
  query,
11
63
  });
@@ -1,4 +1,4 @@
1
- import { getUniswapV4PoolsWithCache } from "../../libs/campaigns/utils/getUniswapV4Pools";
1
+ import { getUniswapV4PoolsWithCache } from "@/libs/campaigns/utils/getUniswapV4Pools";
2
2
  import { t } from "elysia";
3
3
  export const response = t.Array(t.Object({ address: t.String(), asset: t.String(), chaind: t.Number(), debtTokenAddress: t.String() }));
4
4
  export default (app) => app.get("/uniswapv4", async () => {
@@ -1,5 +1,5 @@
1
- import { Redis } from "../../cache";
2
- import { staticCampaignWithCache } from "../../libs/staticCampaigns";
1
+ import { Redis } from "@/cache";
2
+ import { staticCampaignWithCache } from "@/libs/staticCampaigns";
3
3
  import { ChainId, HOUR, isSupportedChain } from "@sdk";
4
4
  import { t } from "elysia";
5
5
  export const query = t.Object({});
@@ -1,8 +1,8 @@
1
- import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
2
- import { RewardService, UserRewardV3Dto } from "../../modules/v4/reward";
3
- import { RewardConvertorService } from "../../modules/v4/reward/reward.converter";
4
- import { InvalidParameter } from "../../utils/error";
5
- import { throwOnUnsupportedChainId } from "../../utils/throw";
1
+ import checkQueryAddressValidity from "@/hooks/checkQueryAddressValidity";
2
+ import { RewardService, UserRewardV3Dto } from "@/modules/v4/reward";
3
+ import { RewardConvertorService } from "@/modules/v4/reward/reward.converter";
4
+ import { InvalidParameter } from "@/utils/error";
5
+ import { throwOnUnsupportedChainId } from "@/utils/throw";
6
6
  import { t } from "elysia";
7
7
  import { utils } from "ethers";
8
8
  import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
@@ -1,35 +1,9 @@
1
1
  import type { BytesLike } from "ethers";
2
- export type CampaignFrontend = {
3
- chainId: number;
4
- index: number;
5
- creator: string;
6
- campaignId: string;
7
- campaignType: string;
8
- campaignSubType: string;
9
- rewardToken: string;
10
- amount: string;
11
- amountDecimal: number;
12
- startTimestamp: number;
13
- endTimestamp: number;
14
- lastProcessedTimestamp: number;
15
- mainParameter: string;
16
- merklApr: string;
17
- otherAprs: string[];
18
- };
19
- export declare enum Campaign {
20
- INVALID = 0,
21
- ERC20 = 1,
22
- CLAMM = 2
23
- }
24
2
  export type MultiCallDataType = {
25
3
  target: string;
26
4
  callData: BytesLike;
27
5
  allowFailure?: boolean;
28
6
  }[];
29
- export type leafCacheType = {
30
- type: "Buffer";
31
- data: number[];
32
- };
33
7
  export type MerklChainData = {
34
8
  merkleRoot: string;
35
9
  treeRoot: string;
@@ -1,6 +1 @@
1
- export var Campaign;
2
- (function (Campaign) {
3
- Campaign[Campaign["INVALID"] = 0] = "INVALID";
4
- Campaign[Campaign["ERC20"] = 1] = "ERC20";
5
- Campaign[Campaign["CLAMM"] = 2] = "CLAMM";
6
- })(Campaign || (Campaign = {}));
1
+ export {};
@@ -1,3 +1,3 @@
1
- import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
1
+ import { tokenType } from "@/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
2
  import { type CallDto } from "@sdk";
3
3
  export declare function createCall(target: string, key: string, type?: tokenType, metaData?: any): CallDto;
@@ -1,4 +1,4 @@
1
- import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
1
+ import { tokenType } from "@/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
2
  import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerV3StablePoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, HourglassERC20TBTInterface, HourglassVedaLockDepositorV2Interface, IonicInterface, LPManagerHelperInterface, LPManagerInterface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, } from "@sdk";
3
3
  export function createCall(target, key, type, metaData) {
4
4
  switch (key) {
@@ -1,4 +1,4 @@
1
- import { HttpError } from "../errors";
1
+ import { HttpError } from "@/errors";
2
2
  import { type ChainId } from "@sdk";
3
3
  import type Elysia from "elysia";
4
4
  import { ValidationError } from "elysia";
@@ -1,4 +1,4 @@
1
- import { HttpError } from "../errors";
1
+ import { HttpError } from "@/errors";
2
2
  import { NETWORK_LABELS } from "@sdk";
3
3
  import { ValidationError } from "elysia";
4
4
  export class InvalidParameter extends Error {
@@ -1,4 +1,4 @@
1
- import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
1
+ import { tokenType } from "@/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
2
  import { type Campaign, type CampaignParameters } from "@sdk";
3
3
  export declare const stakingContractToStakingSymbol: {
4
4
  [key: string]: string;
@@ -1,4 +1,4 @@
1
- import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
1
+ import { tokenType } from "@/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
2
  import { ChainId } from "@sdk";
3
3
  export const stakingContractToStakingSymbol = {
4
4
  "0x18eeD20f71BEf84B605253C89A7576E3634134C0": "CyberStaking",
@@ -1,3 +1,3 @@
1
- import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
1
+ import { tokenType } from "@/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
2
  import type { Campaign, CampaignParameters } from "@sdk";
3
3
  export declare function generateIcons(type: tokenType, typeInfo: any, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, symbols?: string[]): string[];
@@ -1,5 +1,5 @@
1
- import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
- import { OpportunityAction } from "../../database/api/.generated";
1
+ import { tokenType } from "@/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
+ import { OpportunityAction } from "@db/api";
3
3
  export function generateIcons(type, typeInfo, campaign, symbols = [""]) {
4
4
  const action = typeInfo.action ? typeInfo.action : "HOLD";
5
5
  switch (action) {
@@ -1,5 +1,5 @@
1
- import { Redis } from "../cache";
2
- import { hashArray } from "./hashArray";
1
+ import { Redis } from "@/cache";
2
+ import { hashArray } from "@/utils/hashArray";
3
3
  import { BigNumber } from "ethers";
4
4
  import moment from "moment";
5
5
  import { log } from "./logger";
@@ -1,4 +1,4 @@
1
- import { Redis } from "../cache";
1
+ import { Redis } from "@/cache";
2
2
  import { ChainId, NETWORK_LABELS } from "@sdk";
3
3
  import axios from "axios";
4
4
  import { log } from "./logger";
@@ -1,4 +1,4 @@
1
- import { PriceSourceMethod } from "../../../database/api/.generated";
1
+ import { PriceSourceMethod } from "@db/api";
2
2
  import type PriceFetcher from "./services/priceFetcher";
3
3
  /**
4
4
  * @description Factory pattern to get the correct price fetcher
@@ -1,4 +1,4 @@
1
- import { PriceSourceMethod } from "../../../database/api/.generated";
1
+ import { PriceSourceMethod } from "@db/api";
2
2
  import CoingeckoService from "./services/coinGeckoService";
3
3
  import DefillamaService from "./services/defillamaService";
4
4
  import DexScreenerService from "./services/dexScreenerService";
@@ -1,5 +1,5 @@
1
- import { PriceService as PriceSourceService } from "../../modules/v4/price";
2
- import { PriceSourceMethod } from "../../../database/api/.generated";
1
+ import { PriceService as PriceSourceService } from "@/modules/v4/price";
2
+ import { PriceSourceMethod } from "@db/api";
3
3
  import { BN2Number, ChainId, Stable, registry } from "@sdk";
4
4
  import axios from "axios";
5
5
  import { Contract } from "ethers";
@@ -1,4 +1,4 @@
1
- import { type PriceSource } from "../../../../database/api/.generated";
1
+ import { type PriceSource } from "@db/api";
2
2
  import type PriceFetcher from "./priceFetcher";
3
3
  import type { ResponsePriceType } from "./priceFetcher";
4
4
  export default class CoingeckoService implements PriceFetcher {
@@ -1,4 +1,4 @@
1
- import { PriceSourceMethod } from "../../../../database/api/.generated";
1
+ import { PriceSourceMethod } from "@db/api";
2
2
  import axios from "axios";
3
3
  import { log } from "../../logger";
4
4
  export default class CoingeckoService {
@@ -1,4 +1,4 @@
1
- import { type PriceSource } from "../../../../database/api/.generated";
1
+ import { type PriceSource } from "@db/api";
2
2
  import type PriceFetcher from "./priceFetcher";
3
3
  import type { ResponsePriceType } from "./priceFetcher";
4
4
  export default class DefillamaService implements PriceFetcher {
@@ -1,4 +1,4 @@
1
- import { PriceSourceMethod } from "../../../../database/api/.generated";
1
+ import { PriceSourceMethod } from "@db/api";
2
2
  import axios from "axios";
3
3
  import { log } from "../../logger";
4
4
  export default class DefillamaService {
@@ -1,4 +1,4 @@
1
- import { type PriceSource } from "../../../../database/api/.generated";
1
+ import { type PriceSource } from "@db/api";
2
2
  import type PriceFetcher from "./priceFetcher";
3
3
  import type { ResponsePriceType } from "./priceFetcher";
4
4
  export default class DexScreenerService implements PriceFetcher {
@@ -1,4 +1,4 @@
1
- import { PriceSourceMethod } from "../../../../database/api/.generated";
1
+ import { PriceSourceMethod } from "@db/api";
2
2
  import axios from "axios";
3
3
  import { log } from "../../logger";
4
4
  export default class DexScreenerService {
@@ -1,4 +1,4 @@
1
- import { type PriceSource } from "../../../../database/api/.generated";
1
+ import { type PriceSource } from "@db/api";
2
2
  import type PriceFetcher from "./priceFetcher";
3
3
  import type { ResponsePriceType } from "./priceFetcher";
4
4
  export default class ERC4626Service implements PriceFetcher {
@@ -1,5 +1,5 @@
1
- import { PriceService } from "../../../modules/v4/price";
2
- import { PriceSourceMethod } from "../../../../database/api/.generated";
1
+ import { PriceService } from "@/modules/v4/price";
2
+ import { PriceSourceMethod } from "@db/api";
3
3
  import { log } from "../../logger";
4
4
  import { getERC4626Price } from "./getERC4626";
5
5
  export default class ERC4626Service {
@@ -1,4 +1,4 @@
1
- import { type PriceSource } from "../../../../database/api/.generated";
1
+ import { type PriceSource } from "@db/api";
2
2
  import type PriceFetcher from "./priceFetcher";
3
3
  import type { ResponsePriceType } from "./priceFetcher";
4
4
  export default class IndexCoop implements PriceFetcher {
@@ -1,4 +1,4 @@
1
- import { PriceSourceMethod } from "../../../../database/api/.generated";
1
+ import { PriceSourceMethod } from "@db/api";
2
2
  import axios from "axios";
3
3
  import { log } from "../../logger";
4
4
  export default class IndexCoop {
@@ -1,4 +1,4 @@
1
- import type { PriceSource } from "../../../../database/api/.generated";
1
+ import type { PriceSource } from "@db/api";
2
2
  export default interface PriceFetcher {
3
3
  getPrice(tickers: PriceSource[]): Promise<ResponsePriceType[]>;
4
4
  }
@@ -1,12 +1,12 @@
1
- import { PrismaClient as EnginePrismaClient } from "../../database/engine/.generated";
2
- export declare const apiDbClient: import("database/api/.generated/runtime/library").DynamicClientExtensionThis<import("../../database/api/.generated").Prisma.TypeMap<import("database/api/.generated/runtime/library").InternalArgs & {
1
+ import { PrismaClient as EnginePrismaClient } from "@db/engine";
2
+ export declare const apiDbClient: import("database/api/.generated/runtime/library").DynamicClientExtensionThis<import("@db/api").Prisma.TypeMap<import("database/api/.generated/runtime/library").InternalArgs & {
3
3
  result: {};
4
4
  model: {};
5
5
  query: {};
6
6
  client: {
7
7
  $drizzle: () => import("drizzle-orm/prisma/pg").PrismaPgDatabase;
8
8
  };
9
- }, import("../../database/api/.generated").Prisma.PrismaClientOptions>, import("../../database/api/.generated").Prisma.TypeMapCb, {
9
+ }, import("@db/api").Prisma.PrismaClientOptions>, import("@db/api").Prisma.TypeMapCb, {
10
10
  result: {};
11
11
  model: {};
12
12
  query: {};