@merkl/api 0.20.50 → 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 (32) hide show
  1. package/dist/src/eden/index.d.ts +925 -921
  2. package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.d.ts +4 -1
  3. package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.js +15 -0
  4. package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.js +3 -0
  5. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +6 -0
  6. package/dist/src/engine/opportunityMetadata/implementations/Erc20.js +1 -1
  7. package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.d.ts +2 -2
  8. package/dist/src/index.d.ts +175 -171
  9. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +0 -169
  10. package/dist/src/modules/v4/campaign/campaign.controller.js +1 -65
  11. package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +193 -0
  12. package/dist/src/modules/v4/campaign/campaign.test.controller.js +71 -0
  13. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1 -1
  14. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +2 -2
  15. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +67 -2
  16. package/dist/src/modules/v4/programPayload/programPayload.repository.js +67 -0
  17. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +1 -1
  18. package/dist/src/modules/v4/protocol/protocol.controller.js +2 -2
  19. package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
  20. package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
  21. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +1 -9
  22. package/dist/src/modules/v4/protocol/protocol.repository.js +1 -4
  23. package/dist/src/modules/v4/protocol/protocol.service.d.ts +1 -2
  24. package/dist/src/modules/v4/protocol/protocol.service.js +2 -6
  25. package/dist/src/modules/v4/reward/reward.model.d.ts +1 -1
  26. package/dist/src/modules/v4/router.d.ts +175 -171
  27. package/dist/src/modules/v4/router.js +2 -0
  28. package/dist/src/utils/decodeCalls.js +12 -1
  29. package/dist/src/utils/encodeCalls.js +5 -0
  30. package/dist/src/utils/generateCardName.js +9 -0
  31. package/dist/tsconfig.package.tsbuildinfo +1 -1
  32. package/package.json +1 -1
@@ -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), {
@@ -9,7 +9,7 @@ export type Protocol = Resource<"Protocol", undefined, {
9
9
  numberOfLiveCampaigns?: number;
10
10
  opportunityLiveTags?: string[];
11
11
  }>;
12
- export declare const protocolIdList: readonly ["uniswap", "ambient", "arthswap", "base-swap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancake-swap", "quickswap", "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", "koi", "syncswap", "neptune", "zkSwapThreePool", "syncswap", "rfx", "ra", "maverick", "trader-joe", "velodrome", "hanji", "radiant", "aave", "fraxlend", "ironclad", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "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", "angles", "enzyme", "toros", "vicuna", "bunni", "beratrax", "concrete", "cian", "pendle", "splice", "sturdy", "yei", "filament", "gammaswap", "maha", "tempest", "uranium", "hanji", "holdstation", "katana", "satlayer"];
12
+ export declare const protocolIdList: readonly ["uniswap", "ambient", "arthswap", "base-swap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancake-swap", "quickswap", "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", "koi", "syncswap", "neptune", "zkSwapThreePool", "syncswap", "rfx", "ra", "maverick", "trader-joe", "velodrome", "hanji", "radiant", "aave", "fraxlend", "ironclad", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "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", "splice", "sturdy", "yei", "filament", "gammaswap", "maha", "tempest", "uranium", "hanji", "holdstation", "katana", "satlayer"];
13
13
  export type ProtocolId = (typeof protocolIdList)[number];
14
14
  export declare const ProtocolResourceDto: import("@sinclair/typebox").TObject<{
15
15
  id: import("@sinclair/typebox").TString;
@@ -89,6 +89,7 @@ export const protocolIdList = [
89
89
  "superlend",
90
90
  "avalon",
91
91
  "iguana",
92
+ "xlend",
92
93
  // ─── Staking ──────────────────────────────────────────────────────
93
94
  "angles",
94
95
  // ─── Yield Aggregator ──────────────────────────────────────────────
@@ -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);
@@ -35,7 +35,7 @@ export type DailyRewardsRecord = Resource<"DailyRewardsRecord", "opportunityId"
35
35
  export type DailyRewardsBreakdown = Resource<"DailyRewardsBreakdown", "id" | "dailyRewardsRecordId", {
36
36
  token: Token["model"];
37
37
  amount: bigint;
38
- distributionType: DistributionType;
38
+ distributionType?: DistributionType;
39
39
  }>;
40
40
  export declare const DailyRewardsBreakdownRecordResourceDto: import("@sinclair/typebox").TObject<{
41
41
  id: import("@sinclair/typebox").TString;