@merkl/api 0.10.199 → 0.10.201

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. package/dist/src/eden/index.d.ts +2 -6398
  2. package/dist/src/errors/HttpError.d.ts +5 -0
  3. package/dist/src/errors/HttpError.js +6 -0
  4. package/dist/src/errors/NotFound.error.d.ts +4 -0
  5. package/dist/src/errors/NotFound.error.js +5 -0
  6. package/dist/src/index.d.ts +1 -2464
  7. package/dist/src/index.js +56 -7
  8. package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +15 -22
  9. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/factoryFinder.js +1 -0
  10. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +3 -1
  11. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +8 -0
  12. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GammaProcessor.d.ts +43 -0
  13. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GammaProcessor.js +63 -0
  14. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.d.ts +3 -3
  15. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.js +3 -1
  16. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.d.ts +36 -0
  17. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.js +51 -0
  18. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/StakingProcessor.d.ts +0 -1
  19. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/StakingProcessor.js +15 -7
  20. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +4 -0
  21. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPrices.d.ts +1 -1
  22. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPrices.js +13 -572
  23. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.d.ts +2 -21
  24. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +197 -1174
  25. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.d.ts +1 -5
  26. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.js +11 -634
  27. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3.d.ts +1 -4
  28. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3.js +10 -380
  29. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4.d.ts +3 -3
  30. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4.js +11 -312
  31. package/dist/src/libs/campaigns/campaignTypes/EulerDynamicData.js +8 -8
  32. package/dist/src/libs/campaigns/campaignTypes/RadiantDynamicData.js +3 -4
  33. package/dist/src/libs/campaigns/campaignsDynamicData.js +0 -5
  34. package/dist/src/modules/v4/accounting/accounting.controller.js +1 -1
  35. package/dist/src/modules/v4/apr/apr.model.d.ts +26 -0
  36. package/dist/src/modules/v4/apr/apr.model.js +15 -1
  37. package/dist/src/modules/v4/blacklist/blacklist.controller.js +1 -1
  38. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +6 -4
  39. package/dist/src/modules/v4/campaign/campaign.controller.js +14 -4
  40. package/dist/src/modules/v4/campaign/campaign.model.d.ts +51 -5
  41. package/dist/src/modules/v4/campaign/campaign.model.js +48 -13
  42. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +2 -2
  43. package/dist/src/modules/v4/campaign/campaign.repository.js +10 -2
  44. package/dist/src/modules/v4/campaign/campaign.service.d.ts +2 -2
  45. package/dist/src/modules/v4/chain/chain.controller.d.ts +2 -2
  46. package/dist/src/modules/v4/chain/chain.controller.js +7 -2
  47. package/dist/src/modules/v4/chain/chain.model.d.ts +6 -1
  48. package/dist/src/modules/v4/chain/chain.model.js +8 -1
  49. package/dist/src/modules/v4/chain/chain.repository.js +1 -1
  50. package/dist/src/modules/v4/claims/claims.controller.js +1 -1
  51. package/dist/src/modules/v4/dynamicData/dynamicData.controller.js +4 -1
  52. package/dist/src/modules/v4/enso/enso.model.d.ts +1 -1
  53. package/dist/src/modules/v4/enso/enso.model.js +2 -1
  54. package/dist/src/modules/v4/enso/enso.service.d.ts +0 -1
  55. package/dist/src/modules/v4/enso/enso.service.js +4 -4
  56. package/dist/src/modules/v4/interaction/interaction.controller.d.ts +26 -17
  57. package/dist/src/modules/v4/interaction/interaction.controller.js +19 -28
  58. package/dist/src/modules/v4/interaction/interaction.model.d.ts +17 -5
  59. package/dist/src/modules/v4/interaction/interaction.model.js +3 -3
  60. package/dist/src/modules/v4/interaction/interaction.service.d.ts +18 -3
  61. package/dist/src/modules/v4/interaction/interaction.service.js +89 -11
  62. package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +72 -0
  63. package/dist/src/modules/v4/kyberzap/kyberzap.model.js +79 -0
  64. package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +15 -0
  65. package/dist/src/modules/v4/kyberzap/kyberzap.service.js +84 -0
  66. package/dist/src/modules/v4/liquidity/liquidity.controller.js +1 -1
  67. package/dist/src/modules/v4/merklRoot/merklRoot.controller.js +1 -1
  68. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +224 -213
  69. package/dist/src/modules/v4/opportunity/opportunity.controller.js +39 -10
  70. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +252 -22
  71. package/dist/src/modules/v4/opportunity/opportunity.model.js +58 -15
  72. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +11 -11
  73. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +12 -232
  74. package/dist/src/modules/v4/opportunity/opportunity.service.js +0 -32
  75. package/dist/src/modules/v4/price/price.controller.js +1 -1
  76. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +23 -24
  77. package/dist/src/modules/v4/protocol/protocol.controller.js +15 -9
  78. package/dist/src/modules/v4/protocol/protocol.model.d.ts +13 -1
  79. package/dist/src/modules/v4/protocol/protocol.model.js +12 -8
  80. package/dist/src/modules/v4/reward/reward.controller.js +1 -1
  81. package/dist/src/modules/v4/reward/reward.model.d.ts +44 -1
  82. package/dist/src/modules/v4/reward/reward.model.js +15 -0
  83. package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -2
  84. package/dist/src/modules/v4/reward/reward.service.d.ts +11 -11
  85. package/dist/src/modules/v4/reward/reward.service.js +1 -1
  86. package/dist/src/modules/v4/router.d.ts +289 -268
  87. package/dist/src/modules/v4/status/status.controller.js +2 -3
  88. package/dist/src/modules/v4/status/status.model.d.ts +12 -0
  89. package/dist/src/modules/v4/status/status.model.js +12 -0
  90. package/dist/src/modules/v4/token/token.controller.d.ts +4 -4
  91. package/dist/src/modules/v4/token/token.controller.js +1 -1
  92. package/dist/src/modules/v4/token/token.model.d.ts +12 -0
  93. package/dist/src/modules/v4/token/token.model.js +12 -0
  94. package/dist/src/modules/v4/token/token.repository.d.ts +2 -2
  95. package/dist/src/modules/v4/token/token.service.d.ts +7 -7
  96. package/dist/src/modules/v4/tvl/tvl.model.d.ts +24 -0
  97. package/dist/src/modules/v4/tvl/tvl.model.js +15 -1
  98. package/dist/src/modules/v4/uniswapV4/uniswapV4.controller.d.ts +1 -1
  99. package/dist/src/modules/v4/uniswapV4/uniswapV4.controller.js +9 -8
  100. package/dist/src/modules/v4/user/user.controller.d.ts +4 -4
  101. package/dist/src/modules/v4/user/user.controller.js +20 -17
  102. package/dist/src/modules/v4/user/user.model.d.ts +30 -0
  103. package/dist/src/modules/v4/user/user.model.js +27 -0
  104. package/dist/src/modules/v4/zyfi/zyfi.model.d.ts +45 -0
  105. package/dist/src/modules/v4/zyfi/zyfi.model.js +1 -0
  106. package/dist/src/modules/v4/zyfi/zyfi.service.d.ts +30 -0
  107. package/dist/src/modules/v4/zyfi/zyfi.service.js +35 -0
  108. package/dist/src/plugins/error-handling.plugin.d.ts +2 -2
  109. package/dist/src/plugins/error-handling.plugin.js +9 -3
  110. package/dist/src/plugins/logger.plugin.js +1 -20
  111. package/dist/src/routes/v1/allowances.d.ts +1 -1
  112. package/dist/src/routes/v1/allowances.js +1 -1
  113. package/dist/src/routes/v1/balances.d.ts +1 -1
  114. package/dist/src/routes/v1/balances.js +1 -1
  115. package/dist/src/routes/v1/prices.d.ts +1 -1
  116. package/dist/src/routes/v1/prices.js +1 -1
  117. package/dist/src/routes/v1/router.d.ts +102 -0
  118. package/dist/src/routes/v1/router.js +6 -0
  119. package/dist/src/routes/v1/tokens.d.ts +1 -1
  120. package/dist/src/routes/v1/tokens.js +1 -1
  121. package/dist/src/routes/v2/merkl.d.ts +5 -5
  122. package/dist/src/routes/v2/merkl.js +1 -1
  123. package/dist/src/routes/v2/router.d.ts +46 -0
  124. package/dist/src/routes/v2/router.js +3 -0
  125. package/dist/src/routes/v3/app.d.ts +1 -1
  126. package/dist/src/routes/v3/app.js +1 -1
  127. package/dist/src/routes/v3/blacklist.d.ts +1 -2479
  128. package/dist/src/routes/v3/blacklist.js +1 -1
  129. package/dist/src/routes/v3/campaignClaims.d.ts +1 -1
  130. package/dist/src/routes/v3/campaignClaims.js +1 -1
  131. package/dist/src/routes/v3/campaignReport.d.ts +1 -1
  132. package/dist/src/routes/v3/campaignReport.js +1 -1
  133. package/dist/src/routes/v3/campaignUnclaimed.d.ts +1 -1
  134. package/dist/src/routes/v3/campaignUnclaimed.js +1 -1
  135. package/dist/src/routes/v3/campaigns.d.ts +1 -2483
  136. package/dist/src/routes/v3/campaigns.js +1 -1
  137. package/dist/src/routes/v3/campaignsForMainParameter.d.ts +1 -1
  138. package/dist/src/routes/v3/campaignsForMainParameter.js +1 -1
  139. package/dist/src/routes/v3/campaignsInfo.d.ts +1 -2481
  140. package/dist/src/routes/v3/campaignsInfo.js +1 -1
  141. package/dist/src/routes/v3/campaignsRewardsReport.d.ts +1 -1
  142. package/dist/src/routes/v3/campaignsRewardsReport.js +1 -1
  143. package/dist/src/routes/v3/claims.d.ts +2 -2
  144. package/dist/src/routes/v3/claims.js +1 -1
  145. package/dist/src/routes/v3/compoundV2.d.ts +1 -1
  146. package/dist/src/routes/v3/compoundV2.js +1 -1
  147. package/dist/src/routes/v3/createCampaign.d.ts +1 -1
  148. package/dist/src/routes/v3/createCampaign.js +1 -1
  149. package/dist/src/routes/v3/dolomite.d.ts +1 -1
  150. package/dist/src/routes/v3/dolomite.js +1 -1
  151. package/dist/src/routes/v3/euler.d.ts +1 -1
  152. package/dist/src/routes/v3/euler.js +1 -1
  153. package/dist/src/routes/v3/fetch.d.ts +1 -1
  154. package/dist/src/routes/v3/fetch.js +1 -1
  155. package/dist/src/routes/v3/health.d.ts +1 -1
  156. package/dist/src/routes/v3/health.js +1 -1
  157. package/dist/src/routes/v3/lostyield.d.ts +1 -1
  158. package/dist/src/routes/v3/lostyield.js +1 -1
  159. package/dist/src/routes/v3/merkl.d.ts +1 -1
  160. package/dist/src/routes/v3/merkl.js +1 -1
  161. package/dist/src/routes/v3/morphoMarkets.d.ts +1 -1
  162. package/dist/src/routes/v3/morphoMarkets.js +1 -1
  163. package/dist/src/routes/v3/morphoVaults.d.ts +1 -1
  164. package/dist/src/routes/v3/morphoVaults.js +1 -1
  165. package/dist/src/routes/v3/multiChainPositions.d.ts +1 -2480
  166. package/dist/src/routes/v3/multiChainPositions.js +1 -1
  167. package/dist/src/routes/v3/opportunity.d.ts +1 -2483
  168. package/dist/src/routes/v3/opportunity.js +1 -1
  169. package/dist/src/routes/v3/overview.d.ts +1 -1
  170. package/dist/src/routes/v3/overview.js +1 -1
  171. package/dist/src/routes/v3/parse.d.ts +1 -1
  172. package/dist/src/routes/v3/parse.js +1 -1
  173. package/dist/src/routes/v3/payload.d.ts +1 -1
  174. package/dist/src/routes/v3/payload.js +1 -1
  175. package/dist/src/routes/v3/poolInfo.js +1 -1
  176. package/dist/src/routes/v3/positions.d.ts +1 -2479
  177. package/dist/src/routes/v3/positions.js +1 -1
  178. package/dist/src/routes/v3/radiant.d.ts +1 -1
  179. package/dist/src/routes/v3/radiant.js +1 -1
  180. package/dist/src/routes/v3/recipients.d.ts +1 -1
  181. package/dist/src/routes/v3/recipients.js +1 -1
  182. package/dist/src/routes/v3/rewards.d.ts +1 -2508
  183. package/dist/src/routes/v3/rewards.js +1 -1
  184. package/dist/src/routes/v3/rewardsReport.d.ts +1 -1
  185. package/dist/src/routes/v3/rewardsReport.js +1 -1
  186. package/dist/src/routes/v3/router.d.ts +1 -0
  187. package/dist/src/routes/v3/router.js +74 -0
  188. package/dist/src/routes/v3/silo.d.ts +1 -1
  189. package/dist/src/routes/v3/silo.js +1 -1
  190. package/dist/src/routes/v3/token.d.ts +1 -1
  191. package/dist/src/routes/v3/token.js +1 -1
  192. package/dist/src/routes/v3/tokenUnclaimed.d.ts +1 -1
  193. package/dist/src/routes/v3/tokenUnclaimed.js +1 -1
  194. package/dist/src/routes/v3/updates.d.ts +1 -2483
  195. package/dist/src/routes/v3/updates.js +1 -1
  196. package/dist/src/routes/v3/userRewards.d.ts +1 -2499
  197. package/dist/src/routes/v3/userRewards.js +1 -1
  198. package/dist/src/utils/decodeCalls.js +12 -1
  199. package/dist/src/utils/encodeCalls.js +26 -3
  200. package/dist/src/utils/generateCardName.js +2 -0
  201. package/dist/tsconfig.package.tsbuildinfo +1 -1
  202. package/package.json +2 -3
  203. package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicDataRefacto.d.ts +0 -3
  204. package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicDataRefacto.js +0 -155
  205. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPricesRefactoFinal.d.ts +0 -4
  206. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPricesRefactoFinal.js +0 -24
  207. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.d.ts +0 -4
  208. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.js +0 -230
  209. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2RefactoFinal.d.ts +0 -3
  210. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2RefactoFinal.js +0 -22
  211. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3RefactoFinal.d.ts +0 -3
  212. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3RefactoFinal.js +0 -22
  213. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4RefactoFinal.d.ts +0 -4
  214. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4RefactoFinal.js +0 -22
  215. package/dist/src/libs/campaigns/campaignsDynamicDataRefacto.d.ts +0 -3
  216. package/dist/src/libs/campaigns/campaignsDynamicDataRefacto.js +0 -75
@@ -1,7 +1,7 @@
1
1
  import { type CreateCampaignModel } from "../campaign";
2
2
  import { Prisma } from "../../../../database/api/.generated";
3
- import { type ChainId, type MerklChainId } from "@sdk";
4
- import type { CreateOpportunityModel, GetOpportunitiesQueryModel, LightOpportunityFromDB, OpportunityMetadata, OpportunityUnique, UpdateOpportunityModel } from "./opportunity.model";
3
+ import type { ChainId, MerklChainId } from "@sdk";
4
+ import type { CreateOpportunityModel, GetOpportunitiesQueryModel, LightOpportunityFromDB, OpportunityMetadata, OpportunityResourceModel, OpportunityUnique, OpportunityWithCampaignsResourceModel, UpdateOpportunityModel } from "./opportunity.model";
5
5
  import { OpportunityRepository } from "./opportunity.repository";
6
6
  export declare abstract class OpportunityService {
7
7
  static hashId(opportunity: OpportunityUnique): string;
@@ -17,229 +17,9 @@ export declare abstract class OpportunityService {
17
17
  * @returns {OpportunityMetadata}
18
18
  */
19
19
  static getMetadata(campaign: CreateCampaignModel): Promise<OpportunityMetadata>;
20
- static updateNames(): Promise<void>;
21
20
  static updateMetadata(chain: ChainId): Promise<void>;
22
- static getUniqueWithCampaignsOrThrow(opportunityId: string | OpportunityUnique): Promise<({
23
- aprRecord: {
24
- cumulated: number;
25
- timestamp: bigint;
26
- breakdowns: {
27
- type: import("../../../../database/api/.generated").$Enums.AprType;
28
- id: number;
29
- identifier: string;
30
- value: number;
31
- aprRecordId: string;
32
- }[];
33
- };
34
- tvlRecord: {
35
- id: string;
36
- total: number;
37
- timestamp: bigint;
38
- breakdowns: {
39
- type: import("../../../../database/api/.generated").$Enums.TvlType;
40
- id: number;
41
- identifier: string;
42
- value: number;
43
- tvlRecordId: string;
44
- }[];
45
- };
46
- rewardsRecord: {
47
- id: string;
48
- total: number;
49
- timestamp: bigint;
50
- breakdowns: {
51
- id: number;
52
- value: number;
53
- campaignId: string;
54
- dailyRewardsRecordId: string;
55
- token: {
56
- symbol: string;
57
- name: string | null;
58
- id: string;
59
- chainId: number;
60
- address: string;
61
- icon: string;
62
- decimals: number;
63
- displaySymbol: string;
64
- verified: boolean;
65
- isTest: boolean;
66
- price: number | null;
67
- };
68
- amount: bigint;
69
- }[];
70
- };
71
- id: string;
72
- tokens: ({
73
- symbol: string;
74
- name: string | null;
75
- id: string;
76
- chainId: number;
77
- address: string;
78
- icon: string;
79
- decimals: number;
80
- verified: boolean;
81
- isTest: boolean;
82
- } & {
83
- price?: number | null | undefined;
84
- })[];
85
- chain: {
86
- name: string;
87
- id: number;
88
- icon: string;
89
- };
90
- protocol: {
91
- name: string;
92
- url: string;
93
- description: string;
94
- id: string;
95
- tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
96
- icon: string;
97
- } | undefined;
98
- name: string;
99
- type: import("../../../../database/api/.generated").$Enums.CampaignType;
100
- status: import("../../../../database/api/.generated").$Enums.Status;
101
- tags: string[];
102
- identifier: string;
103
- chainId: number;
104
- action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
105
- tvl: number;
106
- apr: number;
107
- dailyRewards: number;
108
- } & {
109
- campaigns: {
110
- params: any;
111
- chain: {
112
- name: string;
113
- id: number;
114
- icon: string;
115
- };
116
- rewardToken: {
117
- symbol: string;
118
- name: string | null;
119
- id: string;
120
- chainId: number;
121
- address: string;
122
- icon: string;
123
- decimals: number;
124
- verified: boolean;
125
- isTest: boolean;
126
- } & {
127
- price?: number | null | undefined;
128
- };
129
- distributionChain: {
130
- name: string;
131
- id: number;
132
- icon: string;
133
- } | undefined;
134
- campaignStatus: {
135
- error: string;
136
- details: Prisma.JsonValue;
137
- status: import("../../../../database/api/.generated").$Enums.RunStatus;
138
- campaignId: string;
139
- computedUntil: bigint;
140
- processingStarted: bigint;
141
- };
142
- type: import("../../../../database/api/.generated").$Enums.CampaignType;
143
- id: string;
144
- subType: number | null;
145
- startTimestamp: bigint;
146
- endTimestamp: bigint;
147
- computeChainId: number;
148
- distributionChainId: number;
149
- campaignId: string;
150
- rewardTokenId: string;
151
- amount: string;
152
- opportunityId: string;
153
- creatorAddress: string;
154
- }[];
155
- }) | null>;
156
- static getUniqueOrThrow(opportunityId: string | OpportunityUnique): Promise<{
157
- aprRecord: {
158
- cumulated: number;
159
- timestamp: bigint;
160
- breakdowns: {
161
- type: import("../../../../database/api/.generated").$Enums.AprType;
162
- id: number;
163
- identifier: string;
164
- value: number;
165
- aprRecordId: string;
166
- }[];
167
- };
168
- tvlRecord: {
169
- id: string;
170
- total: number;
171
- timestamp: bigint;
172
- breakdowns: {
173
- type: import("../../../../database/api/.generated").$Enums.TvlType;
174
- id: number;
175
- identifier: string;
176
- value: number;
177
- tvlRecordId: string;
178
- }[];
179
- };
180
- rewardsRecord: {
181
- id: string;
182
- total: number;
183
- timestamp: bigint;
184
- breakdowns: {
185
- id: number;
186
- value: number;
187
- campaignId: string;
188
- dailyRewardsRecordId: string;
189
- token: {
190
- symbol: string;
191
- name: string | null;
192
- id: string;
193
- chainId: number;
194
- address: string;
195
- icon: string;
196
- decimals: number;
197
- displaySymbol: string;
198
- verified: boolean;
199
- isTest: boolean;
200
- price: number | null;
201
- };
202
- amount: bigint;
203
- }[];
204
- };
205
- id: string;
206
- tokens: ({
207
- symbol: string;
208
- name: string | null;
209
- id: string;
210
- chainId: number;
211
- address: string;
212
- icon: string;
213
- decimals: number;
214
- verified: boolean;
215
- isTest: boolean;
216
- } & {
217
- price?: number | null | undefined;
218
- })[];
219
- chain: {
220
- name: string;
221
- id: number;
222
- icon: string;
223
- };
224
- protocol: {
225
- name: string;
226
- url: string;
227
- description: string;
228
- id: string;
229
- tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
230
- icon: string;
231
- } | undefined;
232
- name: string;
233
- type: import("../../../../database/api/.generated").$Enums.CampaignType;
234
- status: import("../../../../database/api/.generated").$Enums.Status;
235
- tags: string[];
236
- identifier: string;
237
- chainId: number;
238
- action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
239
- tvl: number;
240
- apr: number;
241
- dailyRewards: number;
242
- }>;
21
+ static getUniqueWithCampaignsOrThrow(opportunityId: string | OpportunityUnique): Promise<OpportunityWithCampaignsResourceModel>;
22
+ static getUniqueOrThrow(opportunityId: string | OpportunityUnique): Promise<OpportunityResourceModel>;
243
23
  /**
244
24
  * Get the list of opportunities satisfying the query
245
25
  * @param query
@@ -282,9 +62,9 @@ export declare abstract class OpportunityService {
282
62
  symbol: string;
283
63
  name: string | null;
284
64
  id: string;
65
+ icon: string;
285
66
  chainId: number;
286
67
  address: string;
287
- icon: string;
288
68
  decimals: number;
289
69
  displaySymbol: string;
290
70
  verified: boolean;
@@ -299,9 +79,9 @@ export declare abstract class OpportunityService {
299
79
  symbol: string;
300
80
  name: string | null;
301
81
  id: string;
82
+ icon: string;
302
83
  chainId: number;
303
84
  address: string;
304
- icon: string;
305
85
  decimals: number;
306
86
  verified: boolean;
307
87
  isTest: boolean;
@@ -369,9 +149,9 @@ export declare abstract class OpportunityService {
369
149
  symbol: string;
370
150
  name: string | null;
371
151
  id: string;
152
+ icon: string;
372
153
  chainId: number;
373
154
  address: string;
374
- icon: string;
375
155
  decimals: number;
376
156
  displaySymbol: string;
377
157
  verified: boolean;
@@ -386,9 +166,9 @@ export declare abstract class OpportunityService {
386
166
  symbol: string;
387
167
  name: string | null;
388
168
  id: string;
169
+ icon: string;
389
170
  chainId: number;
390
171
  address: string;
391
- icon: string;
392
172
  decimals: number;
393
173
  verified: boolean;
394
174
  isTest: boolean;
@@ -430,9 +210,9 @@ export declare abstract class OpportunityService {
430
210
  symbol: string;
431
211
  name: string | null;
432
212
  id: string;
213
+ icon: string;
433
214
  chainId: number;
434
215
  address: string;
435
- icon: string;
436
216
  decimals: number;
437
217
  verified: boolean;
438
218
  isTest: boolean;
@@ -513,9 +293,9 @@ export declare abstract class OpportunityService {
513
293
  symbol: string;
514
294
  name: string | null;
515
295
  id: string;
296
+ icon: string;
516
297
  chainId: number;
517
298
  address: string;
518
- icon: string;
519
299
  decimals: number;
520
300
  displaySymbol: string;
521
301
  verified: boolean;
@@ -530,9 +310,9 @@ export declare abstract class OpportunityService {
530
310
  symbol: string;
531
311
  name: string | null;
532
312
  id: string;
313
+ icon: string;
533
314
  chainId: number;
534
315
  address: string;
535
- icon: string;
536
316
  decimals: number;
537
317
  verified: boolean;
538
318
  isTest: boolean;
@@ -569,9 +349,9 @@ export declare abstract class OpportunityService {
569
349
  symbol: string;
570
350
  name: string | null;
571
351
  id: string;
352
+ icon: string;
572
353
  chainId: number;
573
354
  address: string;
574
- icon: string;
575
355
  decimals: number;
576
356
  verified: boolean;
577
357
  isTest: boolean;
@@ -3,7 +3,6 @@ import { CampaignService } from "../campaign";
3
3
  import { log } from "../../../utils/logger";
4
4
  import { OpportunityAction, Prisma } from "../../../../database/api/.generated";
5
5
  import { record } from "@elysiajs/opentelemetry";
6
- import { Campaign } from "@sdk";
7
6
  import { CacheService } from "../cache";
8
7
  import { TTLPresets } from "../cache/cache.model";
9
8
  import { TokenService } from "../token";
@@ -77,35 +76,6 @@ export class OpportunityService {
77
76
  throw "UNKNOWN CAMPAIGN TYPE";
78
77
  }
79
78
  }
80
- static async updateNames() {
81
- const opportunities = await OpportunityRepository.findManyWithCampaigns({});
82
- log.info(`updating ${opportunities.length} opportunities names`);
83
- for (const [i, opp] of opportunities.entries()) {
84
- try {
85
- const campaignData = opp.Campaigns[0];
86
- const campaign = {
87
- ...campaignData,
88
- creator: campaignData.creatorAddress,
89
- chainId: campaignData.distributionChainId,
90
- rewardTokenAddress: campaignData.RewardToken.address,
91
- opportunityIdentifier: opp.identifier,
92
- subType: campaignData.subType ?? undefined,
93
- type: Campaign[campaignData.type],
94
- params: JSON.stringify(campaignData.params),
95
- startTimestamp: campaignData.startTimestamp.toString(),
96
- endTimestamp: campaignData.endTimestamp.toString(),
97
- };
98
- const metadata = await OpportunityService.getMetadata(campaign);
99
- if (opp.name !== metadata.name) {
100
- log.info(`updating opportunity ${opp.id} name from ${opp.name} to ${metadata.name}`);
101
- await OpportunityRepository.updateName(opp.id, metadata.name);
102
- }
103
- }
104
- catch (err) {
105
- log.error(`failed to update opportunity ${opp.id} name`, err);
106
- }
107
- }
108
- }
109
79
  static async updateMetadata(chain) {
110
80
  try {
111
81
  const opportunities = await OpportunityRepository.findManyWithCampaigns({
@@ -131,8 +101,6 @@ export class OpportunityService {
131
101
  const id = typeof opportunityId === "string" ? opportunityId : OpportunityService.hashId(opportunityId);
132
102
  const { Campaigns, ...opportunity } = await OpportunityRepository.findUniqueOrThrowWithCampaigns(id);
133
103
  const formatted = OpportunityService.formatResponse(opportunity);
134
- if (!formatted)
135
- return null;
136
104
  return Object.assign(formatted, { campaigns: Campaigns.map(CampaignService.format) });
137
105
  }
138
106
  static async getUniqueOrThrow(opportunityId) {
@@ -4,7 +4,7 @@ import Elysia from "elysia";
4
4
  import { CreatePriceSourceDto, PriceSourceIdentifier, UpdatePriceSourceDto } from "./price.model";
5
5
  import { PriceService } from "./price.service";
6
6
  // ─── Prices Controller ───────────────────────────────────────────────────────
7
- export const PriceController = new Elysia({ prefix: "/prices", detail: { tags: ["Prices"] } })
7
+ export const PriceController = new Elysia({ prefix: "/prices", detail: { tags: ["Prices"], hide: true } })
8
8
  // ─── Get All Prices ──────────────────────────────────────────────────
9
9
  .get("/", async () => await PriceService.findMany())
10
10
  .get("/array", async () => await PriceService.findManyArray())
@@ -12,29 +12,6 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
12
12
  macro: {};
13
13
  macroFn: {};
14
14
  }, {
15
- protocols: {
16
- ":id": {
17
- get: {
18
- body: unknown;
19
- params: {
20
- id: string;
21
- };
22
- query: unknown;
23
- headers: unknown;
24
- response: {
25
- 200: {
26
- name: string;
27
- url: string;
28
- description: string;
29
- id: string;
30
- tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
31
- icon: string;
32
- } | null;
33
- };
34
- };
35
- };
36
- };
37
- } & {
38
15
  protocols: {
39
16
  index: {
40
17
  get: {
@@ -42,7 +19,6 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
42
19
  params: {};
43
20
  query: {
44
21
  name?: string | undefined;
45
- id?: string[] | undefined;
46
22
  items?: number | undefined;
47
23
  tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
48
24
  page?: number | undefined;
@@ -75,6 +51,29 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
75
51
  };
76
52
  };
77
53
  };
54
+ } & {
55
+ protocols: {
56
+ ":id": {
57
+ get: {
58
+ body: unknown;
59
+ params: {
60
+ id: string;
61
+ };
62
+ query: unknown;
63
+ headers: unknown;
64
+ response: {
65
+ 200: {
66
+ name: string;
67
+ url: string;
68
+ description: string;
69
+ id: string;
70
+ tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
71
+ icon: string;
72
+ } | null;
73
+ };
74
+ };
75
+ };
76
+ };
78
77
  } & {
79
78
  protocols: {
80
79
  ":id": {
@@ -1,25 +1,31 @@
1
1
  import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
2
- import Elysia from "elysia";
3
- import { GetProtocolsQueryDto, ProtocolIdDto, UpdateProtocolDto } from "./protocol.model";
2
+ import Elysia, { t } from "elysia";
3
+ import { GetProtocolsQueryDto, ProtocolIdDto, ProtocolResourceDto, UpdateProtocolDto } from "./protocol.model";
4
4
  import { ProtocolService } from "./protocol.service";
5
5
  // ─── Protocols Controller ────────────────────────────────────────────────────
6
6
  export const ProtocolController = new Elysia({ prefix: "/protocols", detail: { tags: ["Protocols"] } })
7
+ // ─── Get Many Protocols ──────────────────────────────────────────────
8
+ .get("/", async ({ query }) => await ProtocolService.findMany(query), {
9
+ query: GetProtocolsQueryDto,
10
+ response: t.Array(ProtocolResourceDto),
11
+ detail: { description: "List protocols supported and integrated by Merkl." },
12
+ })
13
+ // ─── Count Protocols ──────────────────────────────────────────────
14
+ .get("/count", async ({ query }) => await ProtocolService.countMany(query), {
15
+ detail: { description: "Get the number of protocols correspoinding to the query." },
16
+ })
7
17
  // ─── Get A Protocol By Its Id/Name ────────────────────────────────────────
8
18
  .get("/:id", async ({ params }) => {
9
19
  const fromId = await ProtocolService.getFromId(params.id);
10
20
  if (fromId)
11
21
  return fromId;
12
22
  return await ProtocolService.getFromName(params.id);
13
- })
14
- // ─── Get Many Protocols ──────────────────────────────────────────────
15
- .get("/", async ({ query }) => await ProtocolService.findMany(query), {
16
- query: GetProtocolsQueryDto,
17
- })
18
- // ─── Count Protocols ──────────────────────────────────────────────
19
- .get("/count", async ({ query }) => await ProtocolService.countMany(query))
23
+ }, { detail: { hide: true } })
24
+ // ─── Update A Protocol ───────────────────────────────────────────────
20
25
  .patch("/:id", async ({ params, body }) => await ProtocolService.update(params.id, body), {
21
26
  params: ProtocolIdDto,
22
27
  body: UpdateProtocolDto,
23
28
  headers: AuthorizationHeadersDto,
24
29
  beforeHandle: BackOfficeGuard,
30
+ detail: { hide: true },
25
31
  });
@@ -7,8 +7,20 @@ import type { Resource } from "../prisma";
7
7
  export type Protocol = Resource<"Protocol">;
8
8
  declare const protocolTypes: readonly ["arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap-v3", "quickswap-algebra", "quickswap-uni", "ramses", "retro", "stryke", "stryke-pcs", "stryke-sushi", "sushiswap-v3", "swapr", "thruster", "uniswap-v3", "voltage", "zero", "koi", "supswap-v3", "zkswap", "thirdtrade", "uniswap-v2", "velodrome", "aerodrome", "balancer", "curve", "aura", "akron", "beefy", "dragonswap", "poolside", "koi", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank"];
9
9
  export type ProtocolId = (typeof protocolTypes)[number];
10
+ export declare const ProtocolResourceDto: import("@sinclair/typebox").TObject<{
11
+ id: import("@sinclair/typebox").TString;
12
+ name: import("@sinclair/typebox").TString;
13
+ icon: import("@sinclair/typebox").TString;
14
+ tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TEnum<{
15
+ AMM: "AMM";
16
+ ALM: "ALM";
17
+ DEX: "DEX";
18
+ LENDING: "LENDING";
19
+ }>>;
20
+ description: import("@sinclair/typebox").TString;
21
+ url: import("@sinclair/typebox").TString;
22
+ }>;
10
23
  export declare const GetProtocolsQueryDto: import("@sinclair/typebox").TObject<{
11
- id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>]>, string[]>>;
12
24
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
13
25
  tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TEnum<{
14
26
  AMM: "AMM";
@@ -60,15 +60,19 @@ const protocolTypes = [
60
60
  "layerbank",
61
61
  ];
62
62
  // ─── DTOs ────────────────────────────────────────────────────────────────────
63
+ export const ProtocolResourceDto = t.Object({
64
+ id: t.String(),
65
+ name: t.String(),
66
+ icon: t.String(),
67
+ tags: t.Array(t.Enum(ProtocolTag)),
68
+ description: t.String(),
69
+ url: t.String(),
70
+ });
63
71
  export const GetProtocolsQueryDto = t.Object({
64
- id: t.Optional(t
65
- .Transform(t.Union([t.String(), t.Array(t.String())]))
66
- .Decode(value => (typeof value === "string" ? value.split(",") : value))
67
- .Encode(value => [...value])),
68
- name: t.Optional(t.String()),
69
- tags: t.Optional(t.Array(t.Enum(ProtocolTag))),
70
- page: t.Optional(t.Numeric()),
71
- items: t.Optional(t.Numeric()),
72
+ name: t.Optional(t.String({ description: "Filter results by name. Useful for searching a protocol to verify its integration" })),
73
+ tags: t.Optional(t.Array(t.Enum(ProtocolTag, { description: "Filter by protocol tag" }))),
74
+ page: t.Optional(t.Numeric({ description: "0-indexed page number", default: 0 })),
75
+ items: t.Optional(t.Numeric({ description: "Number of items returned by page", default: 20 })), // items per page
72
76
  });
73
77
  export const GetProtocolParamsDto = t.Object({ id: t.String() });
74
78
  export const UpdateProtocolDto = t.Object({
@@ -5,7 +5,7 @@ import Elysia from "elysia";
5
5
  import { CampaignIdDto, CampaignIdWithoutPageDto, CreateManyBreakdownDto, CreateManyRewardDto, RegisterClaimsDto, UpdatePendingDto, } from "./reward.model";
6
6
  import { RewardService } from "./reward.service";
7
7
  // ─── Rewards Controller ──────────────────────────────────────────────────────
8
- export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags: ["Rewards"] } })
8
+ export const RewardController = new Elysia({ prefix: "/rewards", detail: { tags: ["Rewards"], hide: true } })
9
9
  // ─── Get Reward Breakdowns For Campaign Ids ──────────────────────────
10
10
  .get("/", async ({ query }) => await RewardService.breakdownForCampaign(query), {
11
11
  query: CampaignIdDto,
@@ -1,5 +1,5 @@
1
1
  import type { Resource } from "../prisma";
2
- import type { Token } from "../token";
2
+ import { type Token } from "../token";
3
3
  /**
4
4
  * Rewards Record
5
5
  * @description Describes one rewards value snapshot for an opportunity
@@ -35,6 +35,49 @@ export type DailyRewardsBreakdown = Resource<"DailyRewardsBreakdown", "id" | "da
35
35
  token: Token["model"];
36
36
  amount: bigint;
37
37
  }>;
38
+ export declare const DailyRewardsBreakdownRecordResourceDto: import("@sinclair/typebox").TObject<{
39
+ id: import("@sinclair/typebox").TNumber;
40
+ campaignId: import("@sinclair/typebox").TString;
41
+ value: import("@sinclair/typebox").TNumber;
42
+ dailyRewardsRecordId: import("@sinclair/typebox").TString;
43
+ token: import("@sinclair/typebox").TObject<{
44
+ id: import("@sinclair/typebox").TString;
45
+ name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
46
+ chainId: import("@sinclair/typebox").TNumber;
47
+ address: import("@sinclair/typebox").TString;
48
+ decimals: import("@sinclair/typebox").TNumber;
49
+ icon: import("@sinclair/typebox").TString;
50
+ verified: import("@sinclair/typebox").TBoolean;
51
+ isTest: import("@sinclair/typebox").TBoolean;
52
+ price: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
53
+ symbol: import("@sinclair/typebox").TString;
54
+ }>;
55
+ amount: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
56
+ }>;
57
+ export declare const DailyRewardsRecordResourceDto: import("@sinclair/typebox").TObject<{
58
+ id: import("@sinclair/typebox").TString;
59
+ total: import("@sinclair/typebox").TNumber;
60
+ timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
61
+ breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
62
+ id: import("@sinclair/typebox").TNumber;
63
+ campaignId: import("@sinclair/typebox").TString;
64
+ value: import("@sinclair/typebox").TNumber;
65
+ dailyRewardsRecordId: import("@sinclair/typebox").TString;
66
+ token: import("@sinclair/typebox").TObject<{
67
+ id: import("@sinclair/typebox").TString;
68
+ name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
69
+ chainId: import("@sinclair/typebox").TNumber;
70
+ address: import("@sinclair/typebox").TString;
71
+ decimals: import("@sinclair/typebox").TNumber;
72
+ icon: import("@sinclair/typebox").TString;
73
+ verified: import("@sinclair/typebox").TBoolean;
74
+ isTest: import("@sinclair/typebox").TBoolean;
75
+ price: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
76
+ symbol: import("@sinclair/typebox").TString;
77
+ }>;
78
+ amount: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
79
+ }>>;
80
+ }>;
38
81
  export declare const CreateManyBreakdownDto: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
39
82
  distributionChainId: import("@sinclair/typebox").TNumber;
40
83
  rewardToken: import("@sinclair/typebox").TString;
@@ -1,5 +1,20 @@
1
1
  import { t } from "elysia";
2
+ import { TokenResourceDto } from "../token";
2
3
  // ─── DTOs ────────────────────────────────────────────────────────────────────
4
+ export const DailyRewardsBreakdownRecordResourceDto = t.Object({
5
+ id: t.Number(),
6
+ campaignId: t.String(),
7
+ value: t.Number(),
8
+ dailyRewardsRecordId: t.String(),
9
+ token: TokenResourceDto,
10
+ amount: t.Union([t.BigInt(), t.String()]),
11
+ });
12
+ export const DailyRewardsRecordResourceDto = t.Object({
13
+ id: t.String(),
14
+ total: t.Number(),
15
+ timestamp: t.Union([t.BigInt(), t.String()]),
16
+ breakdowns: t.Array(DailyRewardsBreakdownRecordResourceDto),
17
+ });
3
18
  const BreakdownDto = t.Object({
4
19
  recipient: t.String(),
5
20
  protocolId: t.Optional(t.String()),
@@ -8,9 +8,9 @@ export declare abstract class RewardRepository {
8
8
  symbol: string;
9
9
  name: string | null;
10
10
  id: string;
11
+ icon: string;
11
12
  chainId: number;
12
13
  address: string;
13
- icon: string;
14
14
  decimals: number;
15
15
  displaySymbol: string;
16
16
  verified: boolean;
@@ -30,9 +30,9 @@ export declare abstract class RewardRepository {
30
30
  symbol: string;
31
31
  name: string | null;
32
32
  id: string;
33
+ icon: string;
33
34
  chainId: number;
34
35
  address: string;
35
- icon: string;
36
36
  decimals: number;
37
37
  displaySymbol: string;
38
38
  verified: boolean;