@merkl/api 0.10.78

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 (318) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +125 -0
  3. package/dist/database/api/.generated/default.d.ts +1 -0
  4. package/dist/database/api/.generated/edge.d.ts +1 -0
  5. package/dist/database/api/.generated/index.d.ts +36404 -0
  6. package/dist/database/api/.generated/libquery_engine-debian-openssl-1.1.x.so.node +0 -0
  7. package/dist/database/api/.generated/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
  8. package/dist/database/api/.generated/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
  9. package/dist/database/api/.generated/package.json +84 -0
  10. package/dist/database/api/.generated/runtime/index-browser.d.ts +365 -0
  11. package/dist/database/api/.generated/runtime/library.d.ts +3273 -0
  12. package/dist/database/api/.generated/schema.prisma +366 -0
  13. package/dist/database/api/.generated/wasm.d.ts +1 -0
  14. package/dist/database/api/seeder/resources/protocol.d.ts +353 -0
  15. package/dist/database/engine/.generated/default.d.ts +1 -0
  16. package/dist/database/engine/.generated/edge.d.ts +1 -0
  17. package/dist/database/engine/.generated/index.d.ts +16342 -0
  18. package/dist/database/engine/.generated/libquery_engine-debian-openssl-1.1.x.so.node +0 -0
  19. package/dist/database/engine/.generated/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
  20. package/dist/database/engine/.generated/libquery_engine-linux-musl-arm64-openssl-3.0.x.so.node +0 -0
  21. package/dist/database/engine/.generated/package.json +84 -0
  22. package/dist/database/engine/.generated/runtime/index-browser.d.ts +365 -0
  23. package/dist/database/engine/.generated/runtime/library.d.ts +3273 -0
  24. package/dist/database/engine/.generated/schema.prisma +205 -0
  25. package/dist/database/engine/.generated/wasm.d.ts +1 -0
  26. package/dist/src/backgroundJobs/index.d.ts +1 -0
  27. package/dist/src/backgroundJobs/jobs/campaignsCacheUpdater.d.ts +45 -0
  28. package/dist/src/backgroundJobs/jobs/health.d.ts +40 -0
  29. package/dist/src/backgroundJobs/jobs/opportunityUpdater.d.ts +37 -0
  30. package/dist/src/backgroundJobs/jobs/priceUpdater.d.ts +35 -0
  31. package/dist/src/backgroundJobs/jobs/sync.d.ts +39 -0
  32. package/dist/src/cache/declaration.d.ts +153 -0
  33. package/dist/src/cache/index.d.ts +52 -0
  34. package/dist/src/cache/redis.d.ts +311 -0
  35. package/dist/src/constants.d.ts +349 -0
  36. package/dist/src/eden/index.d.ts +4882 -0
  37. package/dist/src/eden/index.js +4 -0
  38. package/dist/src/entities/campaign.d.ts +58 -0
  39. package/dist/src/entities/opportunity.d.ts +17 -0
  40. package/dist/src/errors/BadRequest.error.d.ts +4 -0
  41. package/dist/src/errors/Conflict.error.d.ts +4 -0
  42. package/dist/src/errors/HttpError.d.ts +6 -0
  43. package/dist/src/errors/NotFound.error.d.ts +4 -0
  44. package/dist/src/errors/Opportunity.error.d.ts +6 -0
  45. package/dist/src/errors/Unauthorized.error.d.ts +4 -0
  46. package/dist/src/errors/index.d.ts +5 -0
  47. package/dist/src/guards/BackOffice.guard.d.ts +7 -0
  48. package/dist/src/guards/Engine.guard.d.ts +7 -0
  49. package/dist/src/guards/TokenAuth.guard.d.ts +7 -0
  50. package/dist/src/hooks/checkQueryAddressValidity.d.ts +21 -0
  51. package/dist/src/hooks/checkQueryChainIdValidity.d.ts +21 -0
  52. package/dist/src/index.d.ts +1889 -0
  53. package/dist/src/internal/controllers/endingCampaigns.d.ts +42 -0
  54. package/dist/src/internal/controllers/unclaimed.d.ts +43 -0
  55. package/dist/src/internal/index.d.ts +1 -0
  56. package/dist/src/libs/campaigns/campaignTypes/AjnaDynamicData.d.ts +5 -0
  57. package/dist/src/libs/campaigns/campaignTypes/BadgerDynamicData.d.ts +5 -0
  58. package/dist/src/libs/campaigns/campaignTypes/CLAMMDynamicData.d.ts +3 -0
  59. package/dist/src/libs/campaigns/campaignTypes/CompoundDynamicData.d.ts +3 -0
  60. package/dist/src/libs/campaigns/campaignTypes/DolomiteDynamicData.d.ts +5 -0
  61. package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.d.ts +3 -0
  62. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/eulerVaultNames.d.ts +1 -0
  63. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/factoryFinder.d.ts +5 -0
  64. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/getBlacklistedSupply.d.ts +1 -0
  65. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/metamorphoTvl.d.ts +1 -0
  66. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/spliceTVL.d.ts +7 -0
  67. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +45 -0
  68. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPrices.d.ts +4 -0
  69. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.d.ts +23 -0
  70. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.d.ts +7 -0
  71. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3.d.ts +6 -0
  72. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4.d.ts +4 -0
  73. package/dist/src/libs/campaigns/campaignTypes/ERC20_SNAPSHOTDynamicData.d.ts +5 -0
  74. package/dist/src/libs/campaigns/campaignTypes/EulerDynamicData.d.ts +3 -0
  75. package/dist/src/libs/campaigns/campaignTypes/JSON_AIRDROPDynamicData.d.ts +5 -0
  76. package/dist/src/libs/campaigns/campaignTypes/MORPHODynamicData.d.ts +5 -0
  77. package/dist/src/libs/campaigns/campaignTypes/RadiantDynamicData.d.ts +3 -0
  78. package/dist/src/libs/campaigns/campaignTypes/SILODynamicData.d.ts +7 -0
  79. package/dist/src/libs/campaigns/campaignsDynamicData.d.ts +3 -0
  80. package/dist/src/libs/campaigns/getCampaigns.d.ts +1 -0
  81. package/dist/src/libs/campaigns/getRewards.d.ts +29 -0
  82. package/dist/src/libs/campaigns/utils/fetchA51Strategies.d.ts +18 -0
  83. package/dist/src/libs/campaigns/utils/fetchClamInfo.d.ts +2 -0
  84. package/dist/src/libs/campaigns/utils/fetchLogs.d.ts +10 -0
  85. package/dist/src/libs/campaigns/utils/getCompV2ForksVaults.d.ts +19 -0
  86. package/dist/src/libs/campaigns/utils/getContractCreationBlock.d.ts +2 -0
  87. package/dist/src/libs/campaigns/utils/getDolomiteMarkets.d.ts +7 -0
  88. package/dist/src/libs/campaigns/utils/getEulerV2Vaults.d.ts +16 -0
  89. package/dist/src/libs/campaigns/utils/getLastEligibilityRatio.d.ts +2 -0
  90. package/dist/src/libs/computeFee.d.ts +4 -0
  91. package/dist/src/libs/custom/twtParticipants.d.ts +6 -0
  92. package/dist/src/libs/deprecated-merklv3/index.d.ts +5 -0
  93. package/dist/src/libs/getTokensList.d.ts +27 -0
  94. package/dist/src/libs/merklChainData.d.ts +4 -0
  95. package/dist/src/libs/parse/marketsWithCache.d.ts +4 -0
  96. package/dist/src/libs/positions/ajna/index.d.ts +41 -0
  97. package/dist/src/libs/positions/badger/index.d.ts +27 -0
  98. package/dist/src/libs/positions/clamm/index.d.ts +8 -0
  99. package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.d.ts +5 -0
  100. package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.d.ts +8 -0
  101. package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.d.ts +11 -0
  102. package/dist/src/libs/positions/clamm/thegraph/index.d.ts +37 -0
  103. package/dist/src/libs/positions/compound/index.d.ts +26 -0
  104. package/dist/src/libs/positions/dolomite/index.d.ts +17 -0
  105. package/dist/src/libs/positions/erc20/index.d.ts +5 -0
  106. package/dist/src/libs/positions/euler/index.d.ts +5 -0
  107. package/dist/src/libs/positions/index.d.ts +3 -0
  108. package/dist/src/libs/positions/morpho/index.d.ts +40 -0
  109. package/dist/src/libs/positions/prepareFetch.d.ts +22 -0
  110. package/dist/src/libs/positions/silo/index.d.ts +5 -0
  111. package/dist/src/libs/positions/types.d.ts +20 -0
  112. package/dist/src/libs/reports/campaignReport.d.ts +9 -0
  113. package/dist/src/libs/reports/mainParameterRewards.d.ts +3 -0
  114. package/dist/src/libs/rewards/userRewards.d.ts +2 -0
  115. package/dist/src/libs/staticCampaigns.d.ts +2 -0
  116. package/dist/src/libs/tokens/balances.d.ts +11 -0
  117. package/dist/src/libs/tokens/tokenInfo.d.ts +8 -0
  118. package/dist/src/modules/v4/accounting/accounting.controller.d.ts +206 -0
  119. package/dist/src/modules/v4/accounting/accounting.model.d.ts +32 -0
  120. package/dist/src/modules/v4/accounting/accounting.repository.d.ts +99 -0
  121. package/dist/src/modules/v4/accounting/accounting.service.d.ts +44 -0
  122. package/dist/src/modules/v4/accounting/index.d.ts +3 -0
  123. package/dist/src/modules/v4/apr/apr.controller.d.ts +0 -0
  124. package/dist/src/modules/v4/apr/apr.model.d.ts +15 -0
  125. package/dist/src/modules/v4/apr/apr.repository.d.ts +0 -0
  126. package/dist/src/modules/v4/apr/apr.service.d.ts +6 -0
  127. package/dist/src/modules/v4/apr/index.d.ts +2 -0
  128. package/dist/src/modules/v4/blacklist/blacklist.controller.d.ts +122 -0
  129. package/dist/src/modules/v4/blacklist/blacklist.model.d.ts +15 -0
  130. package/dist/src/modules/v4/blacklist/blacklist.repository.d.ts +24 -0
  131. package/dist/src/modules/v4/blacklist/blacklist.service.d.ts +24 -0
  132. package/dist/src/modules/v4/blacklist/index.d.ts +3 -0
  133. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +139 -0
  134. package/dist/src/modules/v4/campaign/campaign.model.d.ts +85 -0
  135. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +110 -0
  136. package/dist/src/modules/v4/campaign/campaign.service.d.ts +180 -0
  137. package/dist/src/modules/v4/campaign/index.d.ts +3 -0
  138. package/dist/src/modules/v4/chain/chain.controller.d.ts +91 -0
  139. package/dist/src/modules/v4/chain/chain.model.d.ts +19 -0
  140. package/dist/src/modules/v4/chain/chain.repository.d.ts +66 -0
  141. package/dist/src/modules/v4/chain/chain.service.d.ts +42 -0
  142. package/dist/src/modules/v4/chain/index.d.ts +3 -0
  143. package/dist/src/modules/v4/enso/enso.model.d.ts +130 -0
  144. package/dist/src/modules/v4/enso/enso.service.d.ts +47 -0
  145. package/dist/src/modules/v4/explorer/explorer.repository.d.ts +8 -0
  146. package/dist/src/modules/v4/explorer/explorer.service.d.ts +8 -0
  147. package/dist/src/modules/v4/explorer/index.d.ts +1 -0
  148. package/dist/src/modules/v4/index.d.ts +4 -0
  149. package/dist/src/modules/v4/merklRoot/index.d.ts +3 -0
  150. package/dist/src/modules/v4/merklRoot/merklRoot.controller.d.ts +44 -0
  151. package/dist/src/modules/v4/merklRoot/merklRoot.model.d.ts +6 -0
  152. package/dist/src/modules/v4/merklRoot/merklRoot.repository.d.ts +21 -0
  153. package/dist/src/modules/v4/merklRoot/merklRoot.service.d.ts +34 -0
  154. package/dist/src/modules/v4/opportunity/index.d.ts +3 -0
  155. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +349 -0
  156. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +113 -0
  157. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +432 -0
  158. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +413 -0
  159. package/dist/src/modules/v4/opportunity/subservices/getAjnaMetadata.service.d.ts +3 -0
  160. package/dist/src/modules/v4/opportunity/subservices/getBadgerMetadata.service.d.ts +3 -0
  161. package/dist/src/modules/v4/opportunity/subservices/getClammMetadata.service.d.ts +3 -0
  162. package/dist/src/modules/v4/opportunity/subservices/getCompoundMetadata.service.d.ts +3 -0
  163. package/dist/src/modules/v4/opportunity/subservices/getDolomiteMetadata.service.d.ts +3 -0
  164. package/dist/src/modules/v4/opportunity/subservices/getErc20Metadata.service.d.ts +3 -0
  165. package/dist/src/modules/v4/opportunity/subservices/getErc20SnapshotMetadata.service.d.ts +3 -0
  166. package/dist/src/modules/v4/opportunity/subservices/getEulerMetadata.service.d.ts +3 -0
  167. package/dist/src/modules/v4/opportunity/subservices/getJsonAirDropMetadata.service.d.ts +3 -0
  168. package/dist/src/modules/v4/opportunity/subservices/getMorphoMetadata.service.d.ts +3 -0
  169. package/dist/src/modules/v4/opportunity/subservices/getRadiantMetadata.service.d.ts +3 -0
  170. package/dist/src/modules/v4/opportunity/subservices/getSiloMetadata.service.d.ts +3 -0
  171. package/dist/src/modules/v4/opportunity/transform-id.pipe.d.ts +5 -0
  172. package/dist/src/modules/v4/opportunity/validate-id.pipe.d.ts +5 -0
  173. package/dist/src/modules/v4/participate/participate.controller.d.ts +120 -0
  174. package/dist/src/modules/v4/participate/participate.model.d.ts +51 -0
  175. package/dist/src/modules/v4/participate/participate.service.d.ts +8 -0
  176. package/dist/src/modules/v4/price/index.d.ts +3 -0
  177. package/dist/src/modules/v4/price/price.controller.d.ts +169 -0
  178. package/dist/src/modules/v4/price/price.model.d.ts +32 -0
  179. package/dist/src/modules/v4/price/price.repository.d.ts +33 -0
  180. package/dist/src/modules/v4/price/price.service.d.ts +33 -0
  181. package/dist/src/modules/v4/prisma/index.d.ts +32 -0
  182. package/dist/src/modules/v4/protocol/index.d.ts +3 -0
  183. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +87 -0
  184. package/dist/src/modules/v4/protocol/protocol.model.d.ts +27 -0
  185. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +37 -0
  186. package/dist/src/modules/v4/protocol/protocol.service.d.ts +10 -0
  187. package/dist/src/modules/v4/reward/index.d.ts +3 -0
  188. package/dist/src/modules/v4/reward/reward.controller.d.ts +158 -0
  189. package/dist/src/modules/v4/reward/reward.model.d.ts +158 -0
  190. package/dist/src/modules/v4/reward/reward.repository.d.ts +158 -0
  191. package/dist/src/modules/v4/reward/reward.service.d.ts +523 -0
  192. package/dist/src/modules/v4/reward/rewardConvertor.service.d.ts +14 -0
  193. package/dist/src/modules/v4/router.d.ts +1865 -0
  194. package/dist/src/modules/v4/status/index.d.ts +3 -0
  195. package/dist/src/modules/v4/status/status.controller.d.ts +143 -0
  196. package/dist/src/modules/v4/status/status.model.d.ts +23 -0
  197. package/dist/src/modules/v4/status/status.repository.d.ts +68 -0
  198. package/dist/src/modules/v4/status/status.service.d.ts +38 -0
  199. package/dist/src/modules/v4/token/index.d.ts +3 -0
  200. package/dist/src/modules/v4/token/token.controller.d.ts +131 -0
  201. package/dist/src/modules/v4/token/token.model.d.ts +35 -0
  202. package/dist/src/modules/v4/token/token.repository.d.ts +59 -0
  203. package/dist/src/modules/v4/token/token.service.d.ts +165 -0
  204. package/dist/src/modules/v4/tvl/index.d.ts +2 -0
  205. package/dist/src/modules/v4/tvl/tvl.controller.d.ts +0 -0
  206. package/dist/src/modules/v4/tvl/tvl.model.d.ts +15 -0
  207. package/dist/src/modules/v4/tvl/tvl.repository.d.ts +0 -0
  208. package/dist/src/modules/v4/tvl/tvl.service.d.ts +6 -0
  209. package/dist/src/modules/v4/uniswapV4/index.d.ts +4 -0
  210. package/dist/src/modules/v4/uniswapV4/uniswapV4.controller.d.ts +52 -0
  211. package/dist/src/modules/v4/uniswapV4/uniswapV4.model.d.ts +15 -0
  212. package/dist/src/modules/v4/uniswapV4/uniswapV4.repository.d.ts +2 -0
  213. package/dist/src/modules/v4/uniswapV4/uniswapV4.service.d.ts +20 -0
  214. package/dist/src/modules/v4/user/index.d.ts +3 -0
  215. package/dist/src/modules/v4/user/user.controller.d.ts +325 -0
  216. package/dist/src/modules/v4/user/user.model.d.ts +25 -0
  217. package/dist/src/modules/v4/user/user.repository.d.ts +19 -0
  218. package/dist/src/modules/v4/user/user.service.d.ts +19 -0
  219. package/dist/src/plugins/error-handling.plugin.d.ts +28 -0
  220. package/dist/src/plugins/logger.plugin.d.ts +21 -0
  221. package/dist/src/routes/v1/allowances.d.ts +66 -0
  222. package/dist/src/routes/v1/balances.d.ts +49 -0
  223. package/dist/src/routes/v1/prices.d.ts +41 -0
  224. package/dist/src/routes/v1/tokens.d.ts +44 -0
  225. package/dist/src/routes/v2/merkl.d.ts +54 -0
  226. package/dist/src/routes/v3/ERC20Campaigns.d.ts +1910 -0
  227. package/dist/src/routes/v3/app.d.ts +39 -0
  228. package/dist/src/routes/v3/blacklist.d.ts +1910 -0
  229. package/dist/src/routes/v3/campaign/delay.d.ts +41 -0
  230. package/dist/src/routes/v3/campaignClaims.d.ts +43 -0
  231. package/dist/src/routes/v3/campaignReport.d.ts +42 -0
  232. package/dist/src/routes/v3/campaignUnclaimed.d.ts +43 -0
  233. package/dist/src/routes/v3/campaigns.d.ts +1915 -0
  234. package/dist/src/routes/v3/campaignsForMainParameter.d.ts +42 -0
  235. package/dist/src/routes/v3/campaignsInfo.d.ts +1902 -0
  236. package/dist/src/routes/v3/campaignsRewardsReport.d.ts +43 -0
  237. package/dist/src/routes/v3/claims.d.ts +45 -0
  238. package/dist/src/routes/v3/compoundV2.d.ts +40 -0
  239. package/dist/src/routes/v3/createCampaign.d.ts +46 -0
  240. package/dist/src/routes/v3/dolomite.d.ts +40 -0
  241. package/dist/src/routes/v3/euler.d.ts +40 -0
  242. package/dist/src/routes/v3/exports/campaigns.d.ts +42 -0
  243. package/dist/src/routes/v3/fetch.d.ts +45 -0
  244. package/dist/src/routes/v3/health.d.ts +39 -0
  245. package/dist/src/routes/v3/lostyield.d.ts +52 -0
  246. package/dist/src/routes/v3/merkl.d.ts +87 -0
  247. package/dist/src/routes/v3/morphoMarkets.d.ts +61 -0
  248. package/dist/src/routes/v3/morphoVaults.d.ts +51 -0
  249. package/dist/src/routes/v3/multiChainPositions.d.ts +1909 -0
  250. package/dist/src/routes/v3/opportunity.d.ts +1946 -0
  251. package/dist/src/routes/v3/overview.d.ts +60 -0
  252. package/dist/src/routes/v3/parse.d.ts +46 -0
  253. package/dist/src/routes/v3/payload.d.ts +57 -0
  254. package/dist/src/routes/v3/poolInfo.d.ts +42 -0
  255. package/dist/src/routes/v3/positions.d.ts +1927 -0
  256. package/dist/src/routes/v3/radiant.d.ts +55 -0
  257. package/dist/src/routes/v3/recipients.d.ts +38 -0
  258. package/dist/src/routes/v3/rewards.d.ts +1910 -0
  259. package/dist/src/routes/v3/rewardsReport.d.ts +48 -0
  260. package/dist/src/routes/v3/rootForTimestamp.d.ts +52 -0
  261. package/dist/src/routes/v3/silo.d.ts +52 -0
  262. package/dist/src/routes/v3/token.d.ts +50 -0
  263. package/dist/src/routes/v3/tokenUnclaimed.d.ts +43 -0
  264. package/dist/src/routes/v3/twt/participants.d.ts +40 -0
  265. package/dist/src/routes/v3/updates.d.ts +1907 -0
  266. package/dist/src/routes/v3/userRewards.d.ts +1931 -0
  267. package/dist/src/types/index.d.ts +46 -0
  268. package/dist/src/types/parameters/Action.d.ts +4 -0
  269. package/dist/src/types/parameters/Chain.d.ts +4 -0
  270. package/dist/src/types/parameters/ChainCampaignId.d.ts +4 -0
  271. package/dist/src/types/parameters/MainParameter.d.ts +4 -0
  272. package/dist/src/types/parameters/OpportunityId.d.ts +4 -0
  273. package/dist/src/types/parameters/Timestamp.d.ts +4 -0
  274. package/dist/src/types/parameters/Type.d.ts +4 -0
  275. package/dist/src/types/parameters/index.d.ts +36 -0
  276. package/dist/src/types/returnTypes.d.ts +27 -0
  277. package/dist/src/types/utils.d.ts +5 -0
  278. package/dist/src/utils/addString.d.ts +2 -0
  279. package/dist/src/utils/bigintToString.d.ts +1 -0
  280. package/dist/src/utils/crypto.d.ts +1 -0
  281. package/dist/src/utils/error.d.ts +53 -0
  282. package/dist/src/utils/execute.d.ts +32 -0
  283. package/dist/src/utils/generic.d.ts +24 -0
  284. package/dist/src/utils/hashArray.d.ts +1 -0
  285. package/dist/src/utils/lastBlockBefore.d.ts +3 -0
  286. package/dist/src/utils/logger.d.ts +24 -0
  287. package/dist/src/utils/pricer.d.ts +52 -0
  288. package/dist/src/utils/prices/chainlinkRead.d.ts +4 -0
  289. package/dist/src/utils/prices/curveVirtualPrice.d.ts +4 -0
  290. package/dist/src/utils/prices/getDQUICK.d.ts +4 -0
  291. package/dist/src/utils/prices/priceFetcherFactory.d.ts +10 -0
  292. package/dist/src/utils/prices/priceService.d.ts +13 -0
  293. package/dist/src/utils/prices/services/coinGeckoService.d.ts +12 -0
  294. package/dist/src/utils/prices/services/defillamaService.d.ts +12 -0
  295. package/dist/src/utils/prices/services/dexScreenerService.d.ts +12 -0
  296. package/dist/src/utils/prices/services/erc4626Service.d.ts +9 -0
  297. package/dist/src/utils/prices/services/getERC4626.d.ts +4 -0
  298. package/dist/src/utils/prices/services/indexCoopService.d.ts +12 -0
  299. package/dist/src/utils/prices/services/priceFetcher.d.ts +8 -0
  300. package/dist/src/utils/prices/uniV2Price.d.ts +7 -0
  301. package/dist/src/utils/prisma.d.ts +16 -0
  302. package/dist/src/utils/providers.d.ts +13 -0
  303. package/dist/src/utils/queries/activeCampaigns.d.ts +3 -0
  304. package/dist/src/utils/queries/allCampaigns.d.ts +6 -0
  305. package/dist/src/utils/queries/campaignsForMainParameter.d.ts +2 -0
  306. package/dist/src/utils/queries/claimsOverTime.d.ts +8 -0
  307. package/dist/src/utils/queries/endingCampaigns.d.ts +10 -0
  308. package/dist/src/utils/queries/futureCampaigns.d.ts +3 -0
  309. package/dist/src/utils/queries/mainParameterCampaigns.d.ts +5 -0
  310. package/dist/src/utils/queries/rewardsAmount.d.ts +10 -0
  311. package/dist/src/utils/queries/unclaimed.d.ts +11 -0
  312. package/dist/src/utils/rateLimit.d.ts +63 -0
  313. package/dist/src/utils/stryke.d.ts +2 -0
  314. package/dist/src/utils/throw.d.ts +4 -0
  315. package/dist/src/utils/trace.d.ts +26 -0
  316. package/dist/src/utils/validation.d.ts +5 -0
  317. package/dist/tsconfig.package.tsbuildinfo +1 -0
  318. package/package.json +91 -0
@@ -0,0 +1,205 @@
1
+ generator client {
2
+ provider = "prisma-client-js"
3
+ binaryTargets = ["native", "linux-arm64-openssl-1.1.x", "linux-musl-arm64-openssl-3.0.x"]
4
+ output = ".generated/"
5
+ previewFeatures = ["fullTextSearch"]
6
+ }
7
+
8
+ datasource db {
9
+ provider = "postgresql"
10
+ url = env("DATABASE_ENGINE_URL")
11
+ }
12
+
13
+ model TempLeaves {
14
+ chainId Int
15
+ campaignId String
16
+ recipient String @db.Char(42)
17
+ reason String
18
+ rewardToken String @db.Char(42)
19
+ amount String @default("0")
20
+ auxiliaryData1 Decimal @default(0) @db.Decimal(8, 6) // Average Boost
21
+ auxiliaryData2 Decimal @default(0) @db.Decimal(8, 6)
22
+ lastProcessedTimestamp Int
23
+
24
+ @@id([chainId, campaignId, recipient, reason])
25
+ @@index([chainId])
26
+ @@index([campaignId])
27
+ @@index([recipient])
28
+ @@index([reason])
29
+ @@index([rewardToken])
30
+ }
31
+
32
+ model Leaves {
33
+ chainId Int
34
+ root String
35
+ campaignId String
36
+ recipient String @db.Char(42)
37
+ reason String
38
+ rewardToken String @db.Char(42)
39
+ amount String @default("0")
40
+ auxiliaryData1 Decimal @default(0) @db.Decimal(8, 6) // Average Boost
41
+ auxiliaryData2 Decimal @default(0) @db.Decimal(8, 6)
42
+ lastProcessedTimestamp Int
43
+
44
+ @@id([chainId, campaignId, recipient, reason, root])
45
+ @@index([campaignId])
46
+ @@index([recipient])
47
+ @@index([reason])
48
+ @@index([rewardToken])
49
+ }
50
+
51
+ model Proofs {
52
+ chainId Int
53
+ root String
54
+ recipient String @db.Char(42)
55
+ rewardToken String @db.Char(42)
56
+ proof String[]
57
+
58
+ @@id([chainId, root, recipient, rewardToken])
59
+ @@index([chainId])
60
+ @@index([recipient])
61
+ @@index([rewardToken])
62
+ @@index([root])
63
+ }
64
+
65
+ model MerklRoots {
66
+ chainId Int
67
+ epoch Int
68
+ timestamp Int
69
+ root String
70
+
71
+ @@id([chainId, root])
72
+ @@index([chainId])
73
+ @@index([epoch])
74
+ @@index([root])
75
+ }
76
+
77
+ model Campaigns {
78
+ chainId Int // Chain of the campaign
79
+ computeChainId Int @default(0) // Chain where the compute is done. 0 means it's the same as chainId
80
+ index Int // Index of the campaign
81
+ campaignId String // hash ID of the distrib
82
+ creator String @db.Char(42) // Address of the creator
83
+ campaignType Int // Type of campaign --> univ3, token, univ4
84
+ campaignSubType Int // Subtype of campaign --> UniswapV3, PancakeSwapV3
85
+ rewardToken String // Address of reward token
86
+ amount String
87
+ startTimestamp Int
88
+ endTimestamp Int
89
+
90
+ // Will be useful for table joins
91
+ mainParameter String @db.Char(42) // TODO: confirm it'll always be an address
92
+
93
+ // Config of the distrib
94
+ // A JSON with all the configuration specific to the distribution type
95
+ campaignParameters Json
96
+
97
+ @@id([chainId, campaignId])
98
+ @@index([chainId])
99
+ @@index([rewardToken])
100
+ @@index([startTimestamp])
101
+ @@index([endTimestamp])
102
+ @@index([campaignType])
103
+ @@index([mainParameter])
104
+ }
105
+
106
+ model CampaignsToProcess {
107
+ chainId Int // Chain of the campaign
108
+ computeChainId Int @default(0) // Chain where the compute is done. 0 means it's the same as chainId
109
+ index Int // Index of the campaign
110
+ campaignId String // hash ID of the distrib
111
+ creator String @db.Char(42) // Address of the creator
112
+ campaignType Int // Type of campaign --> univ3, token, univ4
113
+ campaignSubType Int // Subtype of campaign --> UniswapV3, PancakeSwapV3
114
+ rewardToken String // Address of reward token
115
+ amount String
116
+ startTimestamp Int
117
+ endTimestamp Int
118
+
119
+ // Will be useful for table joins
120
+ mainParameter String @db.Char(42) // TODO: confirm it'll always be an address
121
+
122
+ // Config of the distrib
123
+ // A JSON with all the configuration specific to the distribution type
124
+ campaignParameters Json
125
+ lastProcessedTimestamp Int
126
+ processUntilTimestamp Int
127
+ jobIndex Int
128
+
129
+ @@id([chainId, jobIndex])
130
+ @@index([chainId])
131
+ @@index([jobIndex])
132
+ }
133
+
134
+ model Claims {
135
+ chainId Int
136
+ recipient String @db.Char(42)
137
+ campaignId String
138
+ rewardToken String @db.Char(42)
139
+ reason String
140
+ root String
141
+ claimed String @default("0")
142
+ timestamp Int
143
+
144
+ @@id([chainId, recipient, campaignId, rewardToken, reason])
145
+ @@index([chainId])
146
+ @@index([recipient])
147
+ @@index([campaignId])
148
+ }
149
+
150
+ model ClaimsOverTime {
151
+ chainId Int
152
+ recipient String @db.Char(42)
153
+ campaignId String
154
+ rewardToken String @db.Char(42)
155
+ reason String
156
+ root String
157
+ claimed String @default("0")
158
+ timestamp Int
159
+
160
+ @@id([chainId, recipient, campaignId, rewardToken, reason, timestamp])
161
+ @@index([chainId])
162
+ @@index([recipient])
163
+ @@index([campaignId])
164
+ @@index([timestamp])
165
+ }
166
+
167
+ model ALMs {
168
+ chainId Int
169
+ campaignId String // hash ID of the distrib
170
+ name String
171
+ type String
172
+ address String @db.Char(42)
173
+ target String @db.Char(42)
174
+ owner String @db.Char(42)
175
+ underlyingPool String @db.Char(42)
176
+
177
+ @@id([chainId, campaignId, address])
178
+ }
179
+
180
+ model ERC20Holders {
181
+ chainId Int
182
+ token String @db.Char(42)
183
+ holders String[] @db.Char(42)
184
+ blockNumber Int
185
+
186
+ @@id([chainId, token])
187
+ }
188
+
189
+ // TO DROP
190
+
191
+ model Tokens {
192
+ chainId Int
193
+ address String @db.Char(42)
194
+ symbol String
195
+ decimals Int
196
+
197
+ @@id([chainId, address])
198
+ }
199
+
200
+ model CampaignCreators {
201
+ address String @db.Char(42)
202
+ tags String @default("")
203
+
204
+ @@id([address])
205
+ }
@@ -0,0 +1 @@
1
+ export * from './index'
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ import { Campaign, type CampaignDynamicData } from "@sdk";
2
+ import { Elysia } from "elysia";
3
+ export type CampaignsCacheUpdaterReturnType = {
4
+ [type_mainParameter: string]: {
5
+ [campaignId: string]: CampaignDynamicData<Campaign>;
6
+ };
7
+ };
8
+ export declare const campaignsCacheUpdater: Elysia<"", false, {
9
+ decorator: {};
10
+ store: {};
11
+ derive: {};
12
+ resolve: {};
13
+ }, {
14
+ type: {};
15
+ error: {};
16
+ }, {
17
+ schema: {};
18
+ macro: {};
19
+ }, {
20
+ v3: {
21
+ update: {
22
+ get: {
23
+ body: unknown;
24
+ params: Record<never, string>;
25
+ query: {
26
+ chainId: string;
27
+ };
28
+ headers: unknown;
29
+ response: {
30
+ 200: {
31
+ success: boolean;
32
+ };
33
+ };
34
+ };
35
+ };
36
+ };
37
+ }, {
38
+ derive: {};
39
+ resolve: {};
40
+ schema: {};
41
+ }, {
42
+ derive: {};
43
+ resolve: {};
44
+ schema: {};
45
+ }>;
@@ -0,0 +1,40 @@
1
+ import type Elysia from "elysia";
2
+ export declare const response: import("@sinclair/typebox").TObject<{
3
+ success: import("@sinclair/typebox").TBoolean;
4
+ }>;
5
+ export declare const healthCheck: (app: Elysia) => Elysia<"", false, {
6
+ decorator: {};
7
+ store: {};
8
+ derive: {};
9
+ resolve: {};
10
+ }, {
11
+ type: {};
12
+ error: {};
13
+ }, {
14
+ schema: {};
15
+ macro: {};
16
+ }, {
17
+ v3: {
18
+ health: {
19
+ get: {
20
+ body: unknown;
21
+ params: Record<never, string>;
22
+ query: {};
23
+ headers: unknown;
24
+ response: {
25
+ 200: {
26
+ success: boolean;
27
+ };
28
+ };
29
+ };
30
+ };
31
+ };
32
+ }, {
33
+ derive: {};
34
+ resolve: {};
35
+ schema: {};
36
+ }, {
37
+ derive: {};
38
+ resolve: {};
39
+ schema: {};
40
+ }>;
@@ -0,0 +1,37 @@
1
+ import type Elysia from "elysia";
2
+ export declare const OPPORTUNITY_CACHE = "Opportunities_All";
3
+ export declare const OPPORTUNITY_CACHE_TEST = "Opportunities_Test";
4
+ export declare const opportunityUpdater: (app: Elysia) => Elysia<"", false, {
5
+ decorator: {};
6
+ store: {};
7
+ derive: {};
8
+ resolve: {};
9
+ }, {
10
+ type: {};
11
+ error: {};
12
+ }, {
13
+ schema: {};
14
+ macro: {};
15
+ }, {
16
+ v3: {
17
+ updateOpportunities: {
18
+ get: {
19
+ body: unknown;
20
+ params: Record<never, string>;
21
+ query: unknown;
22
+ headers: unknown;
23
+ response: {
24
+ 200: Response;
25
+ };
26
+ };
27
+ };
28
+ };
29
+ }, {
30
+ derive: {};
31
+ resolve: {};
32
+ schema: {};
33
+ }, {
34
+ derive: {};
35
+ resolve: {};
36
+ schema: {};
37
+ }>;
@@ -0,0 +1,35 @@
1
+ import type Elysia from "elysia";
2
+ export declare const priceUpdater: (app: Elysia) => Elysia<"", false, {
3
+ decorator: {};
4
+ store: {};
5
+ derive: {};
6
+ resolve: {};
7
+ }, {
8
+ type: {};
9
+ error: {};
10
+ }, {
11
+ schema: {};
12
+ macro: {};
13
+ }, {
14
+ v3: {
15
+ updatePrices: {
16
+ get: {
17
+ body: unknown;
18
+ params: Record<never, string>;
19
+ query: unknown;
20
+ headers: unknown;
21
+ response: {
22
+ 200: Response;
23
+ };
24
+ };
25
+ };
26
+ };
27
+ }, {
28
+ derive: {};
29
+ resolve: {};
30
+ schema: {};
31
+ }, {
32
+ derive: {};
33
+ resolve: {};
34
+ schema: {};
35
+ }>;
@@ -0,0 +1,39 @@
1
+ import Elysia from "elysia";
2
+ export declare const sync: Elysia<"/jobs", false, {
3
+ decorator: {};
4
+ store: {};
5
+ derive: {};
6
+ resolve: {};
7
+ }, {
8
+ type: {};
9
+ error: {};
10
+ }, {
11
+ schema: {};
12
+ macro: {};
13
+ }, {
14
+ jobs: {
15
+ api: {
16
+ "sync-with-engine": {
17
+ get: {
18
+ body: unknown;
19
+ params: Record<never, string>;
20
+ query: unknown;
21
+ headers: {
22
+ authorization: string;
23
+ };
24
+ response: {
25
+ 200: void;
26
+ };
27
+ };
28
+ };
29
+ };
30
+ };
31
+ }, {
32
+ derive: {};
33
+ resolve: {};
34
+ schema: {};
35
+ }, {
36
+ derive: {};
37
+ resolve: {};
38
+ schema: {};
39
+ }>;
@@ -0,0 +1,153 @@
1
+ import { TTLType } from "./redis";
2
+ export declare const CacheDeclaration: {
3
+ Updates: {
4
+ compressed: false;
5
+ redisTTL: TTLType.Minutes2;
6
+ localCache: false;
7
+ };
8
+ Delays: {
9
+ compressed: false;
10
+ redisTTL: TTLType.Minutes2;
11
+ localCache: false;
12
+ };
13
+ TwtParticipants: {
14
+ compressed: false;
15
+ redisTTL: TTLType.Minutes5;
16
+ localCache: false;
17
+ };
18
+ CampaignRewards: {
19
+ compressed: true;
20
+ redisTTL: TTLType.Hours12;
21
+ localCache: false;
22
+ };
23
+ RewardsMainParameter: {
24
+ compressed: true;
25
+ redisTTL: TTLType.Hours12;
26
+ localCache: false;
27
+ };
28
+ RewardsMainParameterDelta: {
29
+ compressed: true;
30
+ redisTTL: TTLType.Hours12;
31
+ localCache: false;
32
+ };
33
+ CampaignRewardsDelta: {
34
+ compressed: true;
35
+ redisTTL: TTLType.Hours12;
36
+ localCache: false;
37
+ };
38
+ LastBlockBefore: {
39
+ compressed: false;
40
+ redisTTL: TTLType.Hours12;
41
+ localCache: false;
42
+ };
43
+ LostYield: {
44
+ compressed: false;
45
+ redisTTL: TTLType.Hours3;
46
+ localCache: false;
47
+ };
48
+ DolomiteMarkets: {
49
+ compressed: false;
50
+ redisTTL: TTLType.Minutes30;
51
+ localCache: false;
52
+ };
53
+ EulerV2Vaults: {
54
+ compressed: false;
55
+ redisTTL: TTLType.Minutes30;
56
+ localCache: false;
57
+ };
58
+ CompoundV2ForksVaults: {
59
+ compressed: false;
60
+ redisTTL: TTLType.Week;
61
+ localCache: false;
62
+ };
63
+ RadiantMarkets: {
64
+ compressed: false;
65
+ redisTTL: TTLType.Minutes30;
66
+ localCache: false;
67
+ };
68
+ SiloMarkets: {
69
+ compressed: false;
70
+ redisTTL: TTLType.Minutes30;
71
+ localCache: false;
72
+ };
73
+ MorphoMarkets: {
74
+ compressed: false;
75
+ redisTTL: TTLType.Minutes30;
76
+ localCache: false;
77
+ };
78
+ FarmedPositions: {
79
+ compressed: false;
80
+ redisTTL: TTLType.Minutes2;
81
+ localCache: false;
82
+ };
83
+ JsonByTimestamp: {
84
+ compressed: false;
85
+ redisTTL: TTLType.Minutes10;
86
+ localCache: false;
87
+ };
88
+ Prices: {
89
+ compressed: true;
90
+ redisTTL: TTLType.Minutes30;
91
+ localCache: false;
92
+ };
93
+ MerklChainData: {
94
+ compressed: false;
95
+ redisTTL: TTLType.Hours12;
96
+ localCache: false;
97
+ };
98
+ Opportunities: {
99
+ compressed: true;
100
+ redisTTL: TTLType.Hours12;
101
+ localCache: false;
102
+ };
103
+ OpportunitiesWithTest: {
104
+ compressed: true;
105
+ redisTTL: TTLType.Hours12;
106
+ localCache: false;
107
+ };
108
+ Campaigns: {
109
+ compressed: true;
110
+ redisTTL: TTLType.Hours12;
111
+ localCache: false;
112
+ };
113
+ LiveCampaigns: {
114
+ compressed: true;
115
+ redisTTL: TTLType.Hours12;
116
+ localCache: false;
117
+ };
118
+ CampaignsOldFormat: {
119
+ compressed: true;
120
+ redisTTL: TTLType.Hours12;
121
+ localCache: false;
122
+ };
123
+ LiveCampaignsOldFormat: {
124
+ compressed: true;
125
+ redisTTL: TTLType.Hours12;
126
+ localCache: false;
127
+ };
128
+ StaticCampaigns: {
129
+ compressed: true;
130
+ redisTTL: TTLType.Hours12;
131
+ localCache: false;
132
+ };
133
+ Blacklist: {
134
+ compressed: true;
135
+ redisTTL: TTLType.Minutes10;
136
+ localCache: false;
137
+ };
138
+ TokenList: {
139
+ compressed: false;
140
+ redisTTL: TTLType.Minutes30;
141
+ localCache: false;
142
+ };
143
+ CurrentRoot: {
144
+ compressed: false;
145
+ redisTTL: TTLType.Seconds30;
146
+ localCache: true;
147
+ };
148
+ Chains: {
149
+ compressed: false;
150
+ redisTTL: TTLType.Hours3;
151
+ localCache: true;
152
+ };
153
+ };
@@ -0,0 +1,52 @@
1
+ import NodeCache from "node-cache";
2
+ import type { CacheKeys } from "./keys";
3
+ export type CacheArg = {
4
+ [Key in keyof CacheKeys]: CacheKeys[Key]["arg"] extends null ? `${Key}` : `${Key}_${CacheKeys[Key]["arg"]}`;
5
+ };
6
+ export type CacheKey<Key extends keyof CacheKeys = keyof CacheKeys> = Key;
7
+ export type AnyKey<BaseKey extends CacheKey, ActualKey extends BaseKey | NonNullable<CacheArg[BaseKey]>> = ActualKey extends CacheKey ? BaseKey : NonNullable<CacheArg[BaseKey]>;
8
+ export type Getter = <K extends string | string[]>(key: K) => Promise<K extends string[] ? string[] : string>;
9
+ export declare class Cache {
10
+ static decoder: TextDecoder;
11
+ static encoder: TextEncoder;
12
+ localCache: NodeCache;
13
+ static baseKey<T extends CacheKey, Key extends T | NonNullable<CacheArg[T]>>(key: Key): CacheKey;
14
+ /** @notice Uncompress (if enabled), parsed and typed data from the cache */
15
+ static uncompress<T extends CacheKey, Key extends T | NonNullable<CacheArg[T]>>(key: Key, value: string): CacheKeys[T]["returns"];
16
+ /** @notice Compress (if enabled), stringify and encoded data to be stored in the cache */
17
+ static compress<T extends CacheKey, Key extends T | NonNullable<CacheArg[T]>>(key: Key, value: CacheKeys[T]["returns"]): string;
18
+ private getRaw;
19
+ private getManyRaw;
20
+ private setRaw;
21
+ /** @notice Set value for a given key for both local and raw cache */
22
+ private set;
23
+ private isLocallyCached;
24
+ private setLocally;
25
+ private getLocally;
26
+ /**
27
+ * @returns the uncompressed (if enabled), parsed and typed data from the cache
28
+ */
29
+ get<Key extends CacheKey, Args extends CacheKeys[Key]["arg"]>(key: Key, args?: Args): Promise<CacheKeys[Key]["returns"]>;
30
+ /**
31
+ * Get many data from cache
32
+ * @param key cache key
33
+ * @returns the uncompressed (if enabled), parsed and typed data from the cache for all keys
34
+ */
35
+ getMany<T extends CacheKey, Key extends T | NonNullable<CacheArg[T]>>(keys: Key[]): Promise<CacheKeys[T]["returns"][]>;
36
+ /**
37
+ * Get many data from cache with argument
38
+ * @param key cache key
39
+ * @param args arguments to append to cache keys
40
+ * @returns the uncompressed (if enabled), parsed and typed data from the cache for all keys
41
+ */
42
+ getManyWithArgs<Key extends CacheKey, Args extends CacheKeys[Key]["arg"]>(key: CacheKeys[Key]["arg"] extends null ? never : Key, args: Args[]): Promise<CacheKeys[Key]["returns"][]>;
43
+ /**
44
+ * Get data from cache or set it using the callback
45
+ * @param key cache key
46
+ * @returns the uncompressed (if enabled), parsed and typed data from the cache
47
+ */
48
+ getOrSet<T extends CacheKey, Key extends T | NonNullable<CacheArg[T]>, Args extends any[]>(key: AnyKey<T, Key>, callback: (...args: Args) => Promise<CacheKeys[T]["returns"]>, ...args: Args): Promise<CacheKeys[T]["returns"]>;
49
+ /** @notice Set with retrials */
50
+ safeSet<T extends CacheKey, Key extends T | NonNullable<CacheArg[T]>>(key: Key, value: CacheKeys[T]["returns"]): Promise<any>;
51
+ }
52
+ export declare const Redis: Cache;