@merkl/api 0.20.51 → 0.20.52

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 (26) hide show
  1. package/dist/src/eden/index.d.ts +909 -905
  2. package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.d.ts +2 -1
  3. package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.js +5 -0
  4. package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.js +1 -0
  5. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +2 -0
  6. package/dist/src/engine/opportunityMetadata/implementations/Erc20.js +1 -1
  7. package/dist/src/index.d.ts +174 -170
  8. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +0 -169
  9. package/dist/src/modules/v4/campaign/campaign.controller.js +1 -65
  10. package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +193 -0
  11. package/dist/src/modules/v4/campaign/campaign.test.controller.js +71 -0
  12. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +67 -2
  13. package/dist/src/modules/v4/programPayload/programPayload.repository.js +67 -0
  14. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +1 -1
  15. package/dist/src/modules/v4/protocol/protocol.controller.js +2 -2
  16. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +1 -9
  17. package/dist/src/modules/v4/protocol/protocol.repository.js +1 -4
  18. package/dist/src/modules/v4/protocol/protocol.service.d.ts +1 -2
  19. package/dist/src/modules/v4/protocol/protocol.service.js +2 -6
  20. package/dist/src/modules/v4/router.d.ts +174 -170
  21. package/dist/src/modules/v4/router.js +2 -0
  22. package/dist/src/utils/decodeCalls.js +10 -1
  23. package/dist/src/utils/encodeCalls.js +3 -0
  24. package/dist/src/utils/generateCardName.js +5 -0
  25. package/dist/tsconfig.package.tsbuildinfo +1 -1
  26. package/package.json +1 -1
@@ -6,9 +6,8 @@ import { Campaign } from "@sdk";
6
6
  import Elysia, { t } from "elysia";
7
7
  import { throwOnUnsupportedChainId } from "src/utils/throw";
8
8
  import { DynamicDataService } from "../dynamicData/dynamicData.service";
9
- import { OpportunityService } from "../opportunity";
10
9
  import { OpportunityConvertorService } from "../opportunity/opportunity.converter";
11
- import { CampaignConfigMinimal, CampaignResourceDto, CampaignUniqueDto, CampaignsDto, CreateCampaignDto, GetCampaignQueryDto, RemoveManualOverrideDto, UpdateCampaignCreatorDto, UpdateCampaignDto, UpdateMetaDataCampaignDto, } from "./campaign.model";
10
+ import { CampaignResourceDto, CreateCampaignDto, GetCampaignQueryDto, RemoveManualOverrideDto, UpdateCampaignCreatorDto, UpdateCampaignDto, UpdateMetaDataCampaignDto, } from "./campaign.model";
12
11
  import { CampaignService } from "./campaign.service";
13
12
  // ─── Campaigns Controller ────────────────────────────────────────────────────
14
13
  export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { tags: ["Campaigns"] } })
@@ -54,69 +53,6 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
54
53
  const campaignV3 = OpportunityConvertorService.convertV4CampaignToV3(Campaign[campaign.type], CampaignService.format(campaign), campaign.Opportunity.identifier);
55
54
  return await DynamicDataService.updateForCampaigns([campaignV3]);
56
55
  }, { beforeHandle: BackOfficeGuard, headers: AuthorizationHeadersDto, detail: { hide: true } })
57
- // ─── Route for dev and test only ──────────────────────────────────────────────
58
- .group("/dry-run", app => app
59
- // ─── Test Dynamic data computation given a campaignId ───────────────────────
60
- .get("/:campaignId/dynamic-data", async ({ params }) => {
61
- const id = (await CampaignService.findMany({ campaignId: params.campaignId, test: true }))?.[0]?.id;
62
- if (!id)
63
- throw new NotFoundError();
64
- const campaign = await CampaignService.findUniqueOrThrow(id, true);
65
- const campaignV3 = OpportunityConvertorService.convertV4CampaignToV3(Campaign[campaign.type], CampaignService.format(campaign), campaign.Opportunity.identifier);
66
- return await DynamicDataService.updateForCampaignType([campaignV3], campaignV3.campaignType, true);
67
- }, { beforeHandle: BackOfficeGuard, headers: AuthorizationHeadersDto, detail: { hide: true } })
68
- // ─── Test Dynamic data computation with a list of campaignId ───────────────────────
69
- .post("/dynamic-data/list", async ({ body }) => {
70
- const listCampaigns = [];
71
- for (const campaignId of body) {
72
- const id = (await CampaignService.findMany({ campaignId: campaignId, test: true }))?.[0]?.id;
73
- if (!id)
74
- throw new NotFoundError();
75
- const campaign = await CampaignService.findUniqueOrThrow(id, true);
76
- const campaignV3 = OpportunityConvertorService.convertV4CampaignToV3(Campaign[campaign.type], CampaignService.format(campaign), campaign.Opportunity.identifier);
77
- listCampaigns.push(campaignV3);
78
- }
79
- return await DynamicDataService.updateForCampaigns(listCampaigns, true);
80
- }, { beforeHandle: BackOfficeGuard, body: CampaignsDto, headers: AuthorizationHeadersDto, detail: { hide: true } })
81
- // ─── Test Dynamic data computation with campaign config ───────────────────────
82
- .post("/dynamic-data", async ({ body }) => {
83
- const listCampaigns = [CampaignService.createFakeCampaign(body)];
84
- return await DynamicDataService.updateForCampaigns(listCampaigns, true);
85
- }, {
86
- beforeHandle: BackOfficeGuard,
87
- body: CampaignConfigMinimal,
88
- headers: AuthorizationHeadersDto,
89
- detail: { hide: true },
90
- })
91
- // ─── Test Opportunity creation through a campaign config ───────────────────────
92
- // @dev Starts from the engine db to debug opportunity creation failing and preventing the api db to be filled
93
- .post("/metadata", async ({ body }) => {
94
- const engineCampaign = CampaignService.createFakeCampaignEngine(body);
95
- return await OpportunityService.createFromCampaign(engineCampaign, false, false);
96
- }, {
97
- beforeHandle: BackOfficeGuard,
98
- body: CampaignConfigMinimal,
99
- headers: AuthorizationHeadersDto,
100
- detail: { hide: true },
101
- })
102
- // ─── Test Opportunity creation through a campaign Id and a chain ───────────────────────
103
- // @dev Starts from the engine db to debug opportunity creation failing and preventing the api db to be filled
104
- .get("/metadata", async ({ query }) => {
105
- const engineCampaigns = await CampaignService.findEngineCampaigns([
106
- {
107
- distributionChain: query.distributionChain,
108
- campaignId: query.campaignId,
109
- },
110
- ]);
111
- if (!engineCampaigns.length)
112
- throw new NotFoundError("Campaign not found in engine db");
113
- return await OpportunityService.createFromCampaign(engineCampaigns[0], false, false);
114
- }, {
115
- beforeHandle: BackOfficeGuard,
116
- headers: AuthorizationHeadersDto,
117
- query: CampaignUniqueDto,
118
- detail: { hide: true },
119
- }))
120
56
  // ─── Get Many Campaigns ──────────────────────────────────────────────
121
57
  .get("/", async ({ query }) => {
122
58
  if (query.items === 0)
@@ -0,0 +1,193 @@
1
+ import Elysia from "elysia";
2
+ export declare const CampaignTestController: Elysia<"/campaigns", false, {
3
+ decorator: {};
4
+ store: {};
5
+ derive: {};
6
+ resolve: {};
7
+ }, {
8
+ type: {};
9
+ error: {};
10
+ }, {
11
+ schema: {};
12
+ macro: {};
13
+ macroFn: {};
14
+ }, {
15
+ campaigns: {
16
+ "dry-run": {
17
+ ":campaignId": {
18
+ "dynamic-data": {
19
+ get: {
20
+ body: unknown;
21
+ params: {
22
+ campaignId: string;
23
+ };
24
+ query: unknown;
25
+ headers: {
26
+ authorization: string;
27
+ };
28
+ response: {
29
+ 200: unknown[];
30
+ };
31
+ };
32
+ };
33
+ };
34
+ };
35
+ } & {
36
+ "dry-run": {
37
+ "dynamic-data": {
38
+ list: {
39
+ post: {
40
+ body: string[];
41
+ params: {};
42
+ query: unknown;
43
+ headers: {
44
+ authorization: string;
45
+ };
46
+ response: {
47
+ 200: unknown[];
48
+ };
49
+ };
50
+ };
51
+ };
52
+ };
53
+ } & {
54
+ "dry-run": {
55
+ "dynamic-data": {
56
+ post: {
57
+ body: {
58
+ id?: string | undefined;
59
+ subType?: number | undefined;
60
+ campaignId?: string | undefined;
61
+ amount?: string | undefined;
62
+ creatorAddress?: string | undefined;
63
+ type: string;
64
+ params: any;
65
+ computeChainId: number;
66
+ distributionChainId: number;
67
+ startTimestamp: number;
68
+ endTimestamp: number;
69
+ rewardToken: string;
70
+ };
71
+ params: {};
72
+ query: unknown;
73
+ headers: {
74
+ authorization: string;
75
+ };
76
+ response: {
77
+ 200: unknown[];
78
+ };
79
+ };
80
+ };
81
+ };
82
+ } & {
83
+ "dry-run": {
84
+ metadata: {
85
+ post: {
86
+ body: {
87
+ id?: string | undefined;
88
+ subType?: number | undefined;
89
+ campaignId?: string | undefined;
90
+ amount?: string | undefined;
91
+ creatorAddress?: string | undefined;
92
+ type: string;
93
+ params: any;
94
+ computeChainId: number;
95
+ distributionChainId: number;
96
+ startTimestamp: number;
97
+ endTimestamp: number;
98
+ rewardToken: string;
99
+ };
100
+ params: {};
101
+ query: unknown;
102
+ headers: {
103
+ authorization: string;
104
+ };
105
+ response: {
106
+ 200: {
107
+ id: string;
108
+ chainId: number;
109
+ type: string;
110
+ identifier: string;
111
+ name: string;
112
+ status: "PAST" | "LIVE" | "SOON";
113
+ action: any;
114
+ tokens: ({
115
+ symbol: string;
116
+ id: string;
117
+ name: string | null;
118
+ icon: string;
119
+ address: string;
120
+ chainId: number;
121
+ decimals: number;
122
+ verified: boolean;
123
+ isTest: boolean;
124
+ isPoint: boolean;
125
+ isNative: boolean;
126
+ } & {
127
+ price?: number | null | undefined;
128
+ })[];
129
+ mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
130
+ depositUrl: any;
131
+ explorerAddress: string | undefined;
132
+ tags: string[];
133
+ };
134
+ };
135
+ };
136
+ };
137
+ };
138
+ } & {
139
+ "dry-run": {
140
+ metadata: {
141
+ get: {
142
+ body: unknown;
143
+ params: {};
144
+ query: {
145
+ campaignId: string;
146
+ distributionChain: number;
147
+ };
148
+ headers: {
149
+ authorization: string;
150
+ };
151
+ response: {
152
+ 200: {
153
+ id: string;
154
+ chainId: number;
155
+ type: string;
156
+ identifier: string;
157
+ name: string;
158
+ status: "PAST" | "LIVE" | "SOON";
159
+ action: any;
160
+ tokens: ({
161
+ symbol: string;
162
+ id: string;
163
+ name: string | null;
164
+ icon: string;
165
+ address: string;
166
+ chainId: number;
167
+ decimals: number;
168
+ verified: boolean;
169
+ isTest: boolean;
170
+ isPoint: boolean;
171
+ isNative: boolean;
172
+ } & {
173
+ price?: number | null | undefined;
174
+ })[];
175
+ mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
176
+ depositUrl: any;
177
+ explorerAddress: string | undefined;
178
+ tags: string[];
179
+ };
180
+ };
181
+ };
182
+ };
183
+ };
184
+ };
185
+ }, {
186
+ derive: {};
187
+ resolve: {};
188
+ schema: {};
189
+ }, {
190
+ derive: {};
191
+ resolve: {};
192
+ schema: {};
193
+ }>;
@@ -0,0 +1,71 @@
1
+ import { NotFoundError } from "@/errors";
2
+ import { BackOfficeGuard } from "@/guards/BackOffice.guard";
3
+ import { AuthorizationHeadersDto } from "@/guards/Engine.guard";
4
+ import { Campaign } from "@sdk";
5
+ import Elysia from "elysia";
6
+ import { DynamicDataService } from "../dynamicData/dynamicData.service";
7
+ import { OpportunityService } from "../opportunity";
8
+ import { OpportunityConvertorService } from "../opportunity/opportunity.converter";
9
+ import { CampaignConfigMinimal, CampaignUniqueDto, CampaignsDto } from "./campaign.model";
10
+ import { CampaignService } from "./campaign.service";
11
+ // ─── Routes for dev and test only ──────────────────────────────────────────────
12
+ export const CampaignTestController = new Elysia({
13
+ prefix: "/campaigns",
14
+ detail: { tags: ["Campaigns"], hide: true },
15
+ }).group("/dry-run", app => app
16
+ .guard({
17
+ headers: AuthorizationHeadersDto,
18
+ beforeHandle: BackOfficeGuard,
19
+ })
20
+ // ─── Test Dynamic data computation given a campaignId ───────────────────────
21
+ .get("/:campaignId/dynamic-data", async ({ params }) => {
22
+ const id = (await CampaignService.findMany({ campaignId: params.campaignId, test: true }))?.[0]?.id;
23
+ if (!id)
24
+ throw new NotFoundError();
25
+ const campaign = await CampaignService.findUniqueOrThrow(id, true);
26
+ const campaignV3 = OpportunityConvertorService.convertV4CampaignToV3(Campaign[campaign.type], CampaignService.format(campaign), campaign.Opportunity.identifier);
27
+ return await DynamicDataService.updateForCampaignType([campaignV3], campaignV3.campaignType, true);
28
+ })
29
+ // ─── Test Dynamic data computation with a list of campaignId ───────────────────────
30
+ .post("/dynamic-data/list", async ({ body }) => {
31
+ const listCampaigns = [];
32
+ for (const campaignId of body) {
33
+ const id = (await CampaignService.findMany({ campaignId: campaignId, test: true }))?.[0]?.id;
34
+ if (!id)
35
+ throw new NotFoundError();
36
+ const campaign = await CampaignService.findUniqueOrThrow(id, true);
37
+ const campaignV3 = OpportunityConvertorService.convertV4CampaignToV3(Campaign[campaign.type], CampaignService.format(campaign), campaign.Opportunity.identifier);
38
+ listCampaigns.push(campaignV3);
39
+ }
40
+ return await DynamicDataService.updateForCampaigns(listCampaigns, true);
41
+ }, { body: CampaignsDto })
42
+ // ─── Test Dynamic data computation with campaign config ───────────────────────
43
+ .post("/dynamic-data", async ({ body }) => {
44
+ const listCampaigns = [CampaignService.createFakeCampaign(body)];
45
+ return await DynamicDataService.updateForCampaigns(listCampaigns, true);
46
+ }, {
47
+ body: CampaignConfigMinimal,
48
+ })
49
+ // ─── Test Opportunity creation through a campaign config ───────────────────────
50
+ // @dev Starts from the engine db to debug opportunity creation failing and preventing the api db to be filled
51
+ .post("/metadata", async ({ body }) => {
52
+ const engineCampaign = CampaignService.createFakeCampaignEngine(body);
53
+ return await OpportunityService.createFromCampaign(engineCampaign, false, false);
54
+ }, {
55
+ body: CampaignConfigMinimal,
56
+ })
57
+ // ─── Test Opportunity creation through a campaign Id and a chain ───────────────────────
58
+ // @dev Starts from the engine db to debug opportunity creation failing and preventing the api db to be filled
59
+ .get("/metadata", async ({ query }) => {
60
+ const engineCampaigns = await CampaignService.findEngineCampaigns([
61
+ {
62
+ distributionChain: query.distributionChain,
63
+ campaignId: query.campaignId,
64
+ },
65
+ ]);
66
+ if (!engineCampaigns.length)
67
+ throw new NotFoundError("Campaign not found in engine db");
68
+ return await OpportunityService.createFromCampaign(engineCampaigns[0], false, false);
69
+ }, {
70
+ query: CampaignUniqueDto,
71
+ }));
@@ -10,7 +10,14 @@ export declare enum program {
10
10
  Celo = "Celo",
11
11
  Swapx = "Swapx",
12
12
  Etherlink = "Etherlink",
13
- Angles = "Angles"
13
+ Angles = "Angles",
14
+ Ronin = "Ronin"
15
+ }
16
+ export declare enum roninCampaigns {
17
+ Katana_WETH_RON_Ronin = "Katana WETH-RON Ronin 0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
18
+ Katana_AXS_RON_Ronin = "Katana AXS-RON Ronin 0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
19
+ Katana_USDC_RON_Ronin = "Katana USDC-RON Ronin 0x392d372f2a51610e9ac5b741379d5631ca9a1c7f",
20
+ Katana_LRON_RON_Ronin = "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8"
14
21
  }
15
22
  export declare enum anglesCampaigns {
16
23
  Angles_supply_in_angles_liquid = "0x15E96CDecA34B9DE1B31586c1206206aDb92E69D",
@@ -411,6 +418,64 @@ export declare enum modeCampaigns {
411
418
  Bedrock_Ionic_Supply_ionuniBTC_Mode = "Bedrock Ionic Supply uniBTC 0xa48750877a83f7dec11f722178c317b54a44d142",
412
419
  Bedrock_Ironclad_Supply_uniBTC_Mode = "Bedrock Ironclad Supply uniBTC 0x0F041cf2ae959f39215EFfB50d681Df55D4d90B1"
413
420
  }
421
+ declare const RoninInterfaceCampaigns: {
422
+ "Katana WETH-RON Ronin 0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7": {
423
+ campaignType: any;
424
+ computeChainId: any;
425
+ hooks: never[];
426
+ poolAddress: string;
427
+ whitelist: never[];
428
+ blacklist: never[];
429
+ url: string;
430
+ forwarders: never[];
431
+ isOutOfRangeIncentivized: boolean;
432
+ weightFees: number;
433
+ weightToken0: number;
434
+ weightToken1: number;
435
+ };
436
+ "Katana AXS-RON Ronin 0x3230b903e8a5d6e46b5a5028470dd33e7b673722": {
437
+ campaignType: any;
438
+ computeChainId: any;
439
+ hooks: never[];
440
+ poolAddress: string;
441
+ whitelist: never[];
442
+ blacklist: never[];
443
+ url: string;
444
+ forwarders: never[];
445
+ isOutOfRangeIncentivized: boolean;
446
+ weightFees: number;
447
+ weightToken0: number;
448
+ weightToken1: number;
449
+ };
450
+ "Katana USDC-RON Ronin 0x392d372f2a51610e9ac5b741379d5631ca9a1c7f": {
451
+ campaignType: any;
452
+ computeChainId: any;
453
+ hooks: never[];
454
+ poolAddress: string;
455
+ whitelist: never[];
456
+ blacklist: never[];
457
+ url: string;
458
+ forwarders: never[];
459
+ isOutOfRangeIncentivized: boolean;
460
+ weightFees: number;
461
+ weightToken0: number;
462
+ weightToken1: number;
463
+ };
464
+ "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8": {
465
+ campaignType: any;
466
+ computeChainId: any;
467
+ hooks: never[];
468
+ poolAddress: string;
469
+ whitelist: never[];
470
+ blacklist: never[];
471
+ url: string;
472
+ forwarders: never[];
473
+ isOutOfRangeIncentivized: boolean;
474
+ weightFees: number;
475
+ weightToken0: number;
476
+ weightToken1: number;
477
+ };
478
+ };
414
479
  declare const AnglesInterfaceCampaigns: {
415
480
  "0x15E96CDecA34B9DE1B31586c1206206aDb92E69D": {
416
481
  campaignType: any;
@@ -970,6 +1035,6 @@ declare const PufferInterfaceCampaigns: {
970
1035
  [key in pufferCampaigns]: partialConfig;
971
1036
  };
972
1037
  export declare const MerklInterfaceCampaigns: {
973
- [key in program]: typeof PufferInterfaceCampaigns | typeof ZkSyncInterfaceCampaigns | typeof ModeInterfaceCampaigns | typeof VicunaInterfaceCampaigns | typeof SonicmarketInterfaceCampaigns | typeof ReserveInterfaceCampaigns | typeof BeetsInterfaceCampaigns | typeof CeloInterfaceCampaigns | typeof EtherlinkInterfaceCampaigns | typeof SwapxInterfaceCampaigns | typeof AnglesInterfaceCampaigns;
1038
+ [key in program]: typeof PufferInterfaceCampaigns | typeof ZkSyncInterfaceCampaigns | typeof ModeInterfaceCampaigns | typeof VicunaInterfaceCampaigns | typeof SonicmarketInterfaceCampaigns | typeof ReserveInterfaceCampaigns | typeof BeetsInterfaceCampaigns | typeof CeloInterfaceCampaigns | typeof EtherlinkInterfaceCampaigns | typeof SwapxInterfaceCampaigns | typeof AnglesInterfaceCampaigns | typeof RoninInterfaceCampaigns;
974
1039
  };
975
1040
  export {};
@@ -13,7 +13,15 @@ export var program;
13
13
  program["Swapx"] = "Swapx";
14
14
  program["Etherlink"] = "Etherlink";
15
15
  program["Angles"] = "Angles";
16
+ program["Ronin"] = "Ronin";
16
17
  })(program || (program = {}));
18
+ export var roninCampaigns;
19
+ (function (roninCampaigns) {
20
+ roninCampaigns["Katana_WETH_RON_Ronin"] = "Katana WETH-RON Ronin 0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7";
21
+ roninCampaigns["Katana_AXS_RON_Ronin"] = "Katana AXS-RON Ronin 0x3230b903e8a5d6e46b5a5028470dd33e7b673722";
22
+ roninCampaigns["Katana_USDC_RON_Ronin"] = "Katana USDC-RON Ronin 0x392d372f2a51610e9ac5b741379d5631ca9a1c7f";
23
+ roninCampaigns["Katana_LRON_RON_Ronin"] = "Katana LRON-RON Ronin 0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8";
24
+ })(roninCampaigns || (roninCampaigns = {}));
17
25
  export var anglesCampaigns;
18
26
  (function (anglesCampaigns) {
19
27
  anglesCampaigns["Angles_supply_in_angles_liquid"] = "0x15E96CDecA34B9DE1B31586c1206206aDb92E69D";
@@ -482,6 +490,64 @@ export var modeCampaigns;
482
490
  modeCampaigns["Bedrock_Ionic_Supply_ionuniBTC_Mode"] = "Bedrock Ionic Supply uniBTC 0xa48750877a83f7dec11f722178c317b54a44d142";
483
491
  modeCampaigns["Bedrock_Ironclad_Supply_uniBTC_Mode"] = "Bedrock Ironclad Supply uniBTC 0x0F041cf2ae959f39215EFfB50d681Df55D4d90B1";
484
492
  })(modeCampaigns || (modeCampaigns = {}));
493
+ const RoninInterfaceCampaigns = {
494
+ [roninCampaigns.Katana_WETH_RON_Ronin]: {
495
+ campaignType: Campaign.CLAMM,
496
+ computeChainId: ChainId.RONIN,
497
+ hooks: [],
498
+ poolAddress: "0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
499
+ whitelist: [],
500
+ blacklist: [],
501
+ url: "https://app.roninchain.com/liquidity/v3/0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
502
+ forwarders: [],
503
+ isOutOfRangeIncentivized: false,
504
+ weightFees: 2000,
505
+ weightToken0: 4000,
506
+ weightToken1: 4000,
507
+ },
508
+ [roninCampaigns.Katana_AXS_RON_Ronin]: {
509
+ campaignType: Campaign.CLAMM,
510
+ computeChainId: ChainId.RONIN,
511
+ hooks: [],
512
+ poolAddress: "0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
513
+ whitelist: [],
514
+ blacklist: [],
515
+ url: "https://app.roninchain.com/liquidity/v3/0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
516
+ forwarders: [],
517
+ isOutOfRangeIncentivized: false,
518
+ weightFees: 2000,
519
+ weightToken0: 4000,
520
+ weightToken1: 4000,
521
+ },
522
+ [roninCampaigns.Katana_USDC_RON_Ronin]: {
523
+ campaignType: Campaign.CLAMM,
524
+ computeChainId: ChainId.RONIN,
525
+ hooks: [],
526
+ poolAddress: "0x392d372f2a51610e9ac5b741379d5631ca9a1c7f",
527
+ whitelist: [],
528
+ blacklist: [],
529
+ url: "https://app.roninchain.com/liquidity/v3/0x392d372f2a51610e9ac5b741379d5631ca9a1c7f",
530
+ forwarders: [],
531
+ isOutOfRangeIncentivized: false,
532
+ weightFees: 2000,
533
+ weightToken0: 4000,
534
+ weightToken1: 4000,
535
+ },
536
+ [roninCampaigns.Katana_LRON_RON_Ronin]: {
537
+ campaignType: Campaign.CLAMM,
538
+ computeChainId: ChainId.RONIN,
539
+ hooks: [],
540
+ poolAddress: "0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8",
541
+ whitelist: [],
542
+ blacklist: [],
543
+ url: "https://app.roninchain.com/liquidity/v3/0x0fbe1a7f0f006a4a4d817b2aa922889612758ce8",
544
+ forwarders: [],
545
+ isOutOfRangeIncentivized: false,
546
+ weightFees: 2000,
547
+ weightToken0: 4000,
548
+ weightToken1: 4000,
549
+ },
550
+ };
485
551
  const AnglesInterfaceCampaigns = {
486
552
  [anglesCampaigns.Angles_supply_in_angles_liquid]: {
487
553
  campaignType: Campaign.ERC20_FIX_APR,
@@ -5530,4 +5596,5 @@ export const MerklInterfaceCampaigns = {
5530
5596
  [program.Swapx]: SwapxInterfaceCampaigns,
5531
5597
  [program.Etherlink]: EtherlinkInterfaceCampaigns,
5532
5598
  [program.Angles]: AnglesInterfaceCampaigns,
5599
+ [program.Ronin]: RoninInterfaceCampaigns,
5533
5600
  };
@@ -89,7 +89,7 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
89
89
  dailyRewards?: number | undefined;
90
90
  numberOfLiveCampaigns?: number | undefined;
91
91
  opportunityLiveTags?: string[] | undefined;
92
- } | null;
92
+ };
93
93
  };
94
94
  };
95
95
  };
@@ -17,10 +17,10 @@ export const ProtocolController = new Elysia({ prefix: "/protocols", detail: { t
17
17
  })
18
18
  // ─── Get A Protocol By Its Id Or Name ────────────────────────────────
19
19
  .get("/:id", async ({ params }) => {
20
- const fromId = await ProtocolService.getFromId(params.id);
20
+ const fromId = await ProtocolService.findUnique(params.id);
21
21
  if (fromId)
22
22
  return fromId;
23
- return await ProtocolService.getFromName(params.id);
23
+ return (await ProtocolService.findMany({ name: params.id }))?.[0];
24
24
  }, { detail: { hide: true } })
25
25
  // ─── Update A Protocol ───────────────────────────────────────────────
26
26
  .patch("/:id", async ({ params, body }) => await ProtocolService.update(params.id, body), {
@@ -10,7 +10,7 @@ export declare abstract class ProtocolRepository {
10
10
  icon: string;
11
11
  }>;
12
12
  static changeId(oldId: string, newId: string): Promise<void>;
13
- static read(type: string): Promise<{
13
+ static findUnique(type: string): Promise<{
14
14
  id: string;
15
15
  name: string;
16
16
  url: string;
@@ -18,14 +18,6 @@ export declare abstract class ProtocolRepository {
18
18
  tags: string[];
19
19
  icon: string;
20
20
  } | null>;
21
- static findManyByName(name: string): Promise<{
22
- id: string;
23
- name: string;
24
- url: string;
25
- description: string;
26
- tags: string[];
27
- icon: string;
28
- }[]>;
29
21
  static findMany(query: GetProtocolsQueryModel): Promise<({
30
22
  MainOpportunities: ({
31
23
  Campaigns: {
@@ -118,12 +118,9 @@ export class ProtocolRepository {
118
118
  log.warn(`protocol with id ${oldId} not found`);
119
119
  }
120
120
  }
121
- static async read(type) {
121
+ static async findUnique(type) {
122
122
  return await apiDbClient.protocol.findUnique({ where: { id: type } });
123
123
  }
124
- static async findManyByName(name) {
125
- return await apiDbClient.protocol.findMany({ where: { name: { equals: name } } });
126
- }
127
124
  static async findMany(query) {
128
125
  const { page: _page, items: _items } = query;
129
126
  const page = _page ? _page : 0;
@@ -3,8 +3,7 @@ export declare abstract class ProtocolService {
3
3
  #private;
4
4
  static findMany(query: GetProtocolsQueryModel): Promise<Protocol["model"][]>;
5
5
  static countMany(query: GetProtocolsQueryModel): Promise<number>;
6
- static getFromId(id: ProtocolId | string): Promise<Protocol["model"] | null>;
7
- static getFromName(name: string): Promise<Protocol["model"] | null>;
6
+ static findUnique(id: ProtocolId | string): Promise<Protocol["model"] | null>;
8
7
  static create(data: CreateProtocolModel): Promise<{
9
8
  id: string;
10
9
  name: string;
@@ -24,12 +24,8 @@ export class ProtocolService {
24
24
  static async countMany(query) {
25
25
  return ProtocolRepository.countMany(query);
26
26
  }
27
- static async getFromId(id) {
28
- return ProtocolRepository.read(id);
29
- }
30
- // Todo : Should be a findfirst by name here
31
- static async getFromName(name) {
32
- return (await ProtocolRepository.findManyByName(name))[0];
27
+ static async findUnique(id) {
28
+ return ProtocolRepository.findUnique(id);
33
29
  }
34
30
  static async create(data) {
35
31
  return await ProtocolRepository.create(data);