@merkl/api 0.20.177 → 0.20.178

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.
@@ -307,6 +307,7 @@ declare const eden: {
307
307
  get: (options: {
308
308
  headers?: Record<string, unknown> | undefined;
309
309
  query: {
310
+ campaigns?: boolean | undefined;
310
311
  point?: boolean | undefined;
311
312
  test?: boolean | undefined;
312
313
  };
@@ -416,6 +417,7 @@ declare const eden: {
416
417
  get: (options: {
417
418
  headers?: Record<string, unknown> | undefined;
418
419
  query: {
420
+ campaigns?: boolean | undefined;
419
421
  point?: boolean | undefined;
420
422
  test?: boolean | undefined;
421
423
  };
@@ -6202,6 +6204,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6202
6204
  id: string;
6203
6205
  };
6204
6206
  query: {
6207
+ campaigns?: boolean | undefined;
6205
6208
  point?: boolean | undefined;
6206
6209
  test?: boolean | undefined;
6207
6210
  };
@@ -6513,6 +6516,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6513
6516
  id: string;
6514
6517
  };
6515
6518
  query: {
6519
+ campaigns?: boolean | undefined;
6516
6520
  point?: boolean | undefined;
6517
6521
  test?: boolean | undefined;
6518
6522
  };
@@ -12354,6 +12358,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12354
12358
  get: (options: {
12355
12359
  headers?: Record<string, unknown> | undefined;
12356
12360
  query: {
12361
+ campaigns?: boolean | undefined;
12357
12362
  point?: boolean | undefined;
12358
12363
  test?: boolean | undefined;
12359
12364
  };
@@ -12463,6 +12468,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12463
12468
  get: (options: {
12464
12469
  headers?: Record<string, unknown> | undefined;
12465
12470
  query: {
12471
+ campaigns?: boolean | undefined;
12466
12472
  point?: boolean | undefined;
12467
12473
  test?: boolean | undefined;
12468
12474
  };
@@ -810,6 +810,7 @@ declare const app: Elysia<"", false, {
810
810
  id: string;
811
811
  };
812
812
  query: {
813
+ campaigns?: boolean | undefined;
813
814
  point?: boolean | undefined;
814
815
  test?: boolean | undefined;
815
816
  };
@@ -1121,6 +1122,7 @@ declare const app: Elysia<"", false, {
1121
1122
  id: string;
1122
1123
  };
1123
1124
  query: {
1125
+ campaigns?: boolean | undefined;
1124
1126
  point?: boolean | undefined;
1125
1127
  test?: boolean | undefined;
1126
1128
  };
@@ -665,6 +665,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
665
665
  id: string;
666
666
  };
667
667
  query: {
668
+ campaigns?: boolean | undefined;
668
669
  point?: boolean | undefined;
669
670
  test?: boolean | undefined;
670
671
  };
@@ -976,6 +977,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
976
977
  id: string;
977
978
  };
978
979
  query: {
980
+ campaigns?: boolean | undefined;
979
981
  point?: boolean | undefined;
980
982
  test?: boolean | undefined;
981
983
  };
@@ -95,13 +95,13 @@ export const OpportunityController = new Elysia({
95
95
  .get("/:id", async ({ params, query }) => {
96
96
  try {
97
97
  if (!params.id.includes("-"))
98
- return await OpportunityService.findUniqueOrThrow(params.id, query.test ?? false);
98
+ return await OpportunityService.findUniqueOrThrow(params.id, query.campaigns ?? false, query.test ?? false, query.point ?? false);
99
99
  const [chainId, type, identifier] = params.id.split("-");
100
100
  return await OpportunityService.findUniqueOrThrow({
101
101
  chainId: +chainId,
102
102
  type: type,
103
103
  identifier,
104
- }, query.test ?? false);
104
+ }, query.campaigns ?? false, query.test ?? false, query.point ?? false);
105
105
  }
106
106
  catch (err) {
107
107
  if (err.code && err.code === "P2025")
@@ -329,6 +329,7 @@ export declare const GetOpportunitiesQueryDto: import("@sinclair/typebox").TObje
329
329
  export declare const GetOpportunityQueryDto: import("@sinclair/typebox").TObject<{
330
330
  test: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
331
331
  point: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
332
+ campaigns: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
332
333
  }>;
333
334
  export declare const CreateOpportunityDto: import("@sinclair/typebox").TObject<{
334
335
  chainId: import("@sinclair/typebox").TNumber;
@@ -95,6 +95,7 @@ export const GetOpportunitiesQueryDto = t.Object({
95
95
  export const GetOpportunityQueryDto = t.Object({
96
96
  test: t.Optional(t.Boolean({ description: "Include test campaigns" })),
97
97
  point: t.Optional(t.Boolean({ description: "Include point campaigns", default: false })),
98
+ campaigns: t.Optional(t.Boolean({ description: "Include campaign data. Will slow down the request. Default: false" })),
98
99
  });
99
100
  export const CreateOpportunityDto = t.Object({
100
101
  chainId: t.Number(),
@@ -622,7 +622,7 @@ export declare abstract class OpportunityService {
622
622
  };
623
623
  }[];
624
624
  }>;
625
- static findUniqueOrThrow(opportunityId: string | OpportunityUnique, withTest?: boolean, withPoints?: boolean): Promise<OpportunityResourceModel>;
625
+ static findUniqueOrThrow(opportunityId: string | OpportunityUnique, withCampaigns?: boolean, withTest?: boolean, withPoints?: boolean): Promise<OpportunityResourceModel>;
626
626
  /**
627
627
  * Get the list of opportunities satisfying the query
628
628
  * @param query
@@ -192,9 +192,9 @@ export class OpportunityService {
192
192
  const opportunity = await OpportunityRepository.findUniqueOrThrow(id, withTest, withTest ? withTest : withPoints, true);
193
193
  return OpportunityService.formatResponse(opportunity);
194
194
  }
195
- static async findUniqueOrThrow(opportunityId, withTest = false, withPoints = false) {
195
+ static async findUniqueOrThrow(opportunityId, withCampaigns = false, withTest = false, withPoints = false) {
196
196
  const id = typeof opportunityId === "string" ? opportunityId : OpportunityService.hashId(opportunityId);
197
- const opportunity = await OpportunityRepository.findUniqueOrThrow(id, withTest, withTest ? withTest : withPoints);
197
+ const opportunity = await OpportunityRepository.findUniqueOrThrow(id, withTest, withTest ? withTest : withPoints, withCampaigns);
198
198
  return OpportunityService.formatResponse(opportunity);
199
199
  }
200
200
  /**
@@ -13,7 +13,8 @@ export declare enum program {
13
13
  Angles = "Angles",
14
14
  Ronin = "Ronin",
15
15
  TAC = "TAC",
16
- HypuurFi = "HypuurFi"
16
+ HypuurFi = "HypuurFi",
17
+ WorldChain = "WorldChain"
17
18
  }
18
19
  export declare enum roninCampaigns {
19
20
  Katana_WETH_RON_Ronin = "Katana WETH-RON Ronin 0x90f31f1907a4d1443a6aacdc91ac2312f91bafa7",
@@ -1594,7 +1595,20 @@ declare const TACInterfaceCampaigns: {
1594
1595
  apr: string;
1595
1596
  };
1596
1597
  };
1598
+ export declare enum WorldChainCampaigns {
1599
+ WorldChain_Vault_Re7USDC = "WorldChain Vault Re7 USDC 0xb1E80387EbE53Ff75a89736097D34dC8D9E9045B",
1600
+ WorldChain_Vault_Re7WLD = "WorldChain Vault Re7 WLD 0x348831b46876d3dF2Db98BdEc5E3B4083329Ab9f",
1601
+ WorldChain_Vault_Re7WETH = "WorldChain Vault Re7 WETH 0x0Db7E405278c2674F462aC9D9eb8b8346D1c1571",
1602
+ WorldChain_MorphoBorrow_WLD_USDC = "WorldChain MorphoBorrow WLD/USDC 0xba0ae12a5cdbf9a458566be68055f30c859771612950b5e43428a51becc6f6e9",
1603
+ WorldChain_MorphoBorrow_WETH_USDC = "WorldChain MorphoBorrow WETH/USDC 0x5fadb14df6523eb13a939f8024dbc54b10bdb4e521741e9995e2951337134b53",
1604
+ WorldChain_MorphoBorrow_WBTC_USDC = "WorldChain MorphoBorrow WBTC/USDC 0x787c5ff694f04e20cc6b3932cd662425161109bb0d63b189c48d99e714a3bd69",
1605
+ WorldChain_Vault_WORLDID_USDC = "WorldChain Vault World ID USDC 0xb1E80387EbE53Ff75a89736097D34dC8D9E9045B",
1606
+ WorldChain_Vault_WORLDID_WLD = "WorldChain Vault World ID WLD 0x348831b46876d3dF2Db98BdEc5E3B4083329Ab9f"
1607
+ }
1608
+ declare const WorldChainInterfaceCampaigns: {
1609
+ [key in WorldChainCampaigns]: partialConfig;
1610
+ };
1597
1611
  export declare const MerklInterfaceCampaigns: {
1598
- [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 | typeof TACInterfaceCampaigns | typeof HypuurFiCampaignsInterface;
1612
+ [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 | typeof TACInterfaceCampaigns | typeof HypuurFiCampaignsInterface | typeof WorldChainInterfaceCampaigns;
1599
1613
  };
1600
1614
  export {};
@@ -17,6 +17,7 @@ export var program;
17
17
  program["Ronin"] = "Ronin";
18
18
  program["TAC"] = "TAC";
19
19
  program["HypuurFi"] = "HypuurFi";
20
+ program["WorldChain"] = "WorldChain";
20
21
  })(program || (program = {}));
21
22
  export var roninCampaigns;
22
23
  (function (roninCampaigns) {
@@ -6572,6 +6573,121 @@ const TACInterfaceCampaigns = {
6572
6573
  apr: ((BaseTACREWARDS * tacuTACMultiplier * 365) / DAILYREWARDSINDOLLAR).toFixed(2).toString(),
6573
6574
  },
6574
6575
  };
6576
+ export var WorldChainCampaigns;
6577
+ (function (WorldChainCampaigns) {
6578
+ WorldChainCampaigns["WorldChain_Vault_Re7USDC"] = "WorldChain Vault Re7 USDC 0xb1E80387EbE53Ff75a89736097D34dC8D9E9045B";
6579
+ WorldChainCampaigns["WorldChain_Vault_Re7WLD"] = "WorldChain Vault Re7 WLD 0x348831b46876d3dF2Db98BdEc5E3B4083329Ab9f";
6580
+ WorldChainCampaigns["WorldChain_Vault_Re7WETH"] = "WorldChain Vault Re7 WETH 0x0Db7E405278c2674F462aC9D9eb8b8346D1c1571";
6581
+ WorldChainCampaigns["WorldChain_MorphoBorrow_WLD_USDC"] = "WorldChain MorphoBorrow WLD/USDC 0xba0ae12a5cdbf9a458566be68055f30c859771612950b5e43428a51becc6f6e9";
6582
+ WorldChainCampaigns["WorldChain_MorphoBorrow_WETH_USDC"] = "WorldChain MorphoBorrow WETH/USDC 0x5fadb14df6523eb13a939f8024dbc54b10bdb4e521741e9995e2951337134b53";
6583
+ WorldChainCampaigns["WorldChain_MorphoBorrow_WBTC_USDC"] = "WorldChain MorphoBorrow WBTC/USDC 0x787c5ff694f04e20cc6b3932cd662425161109bb0d63b189c48d99e714a3bd69";
6584
+ WorldChainCampaigns["WorldChain_Vault_WORLDID_USDC"] = "WorldChain Vault World ID USDC 0xb1E80387EbE53Ff75a89736097D34dC8D9E9045B";
6585
+ WorldChainCampaigns["WorldChain_Vault_WORLDID_WLD"] = "WorldChain Vault World ID WLD 0x348831b46876d3dF2Db98BdEc5E3B4083329Ab9f";
6586
+ })(WorldChainCampaigns || (WorldChainCampaigns = {}));
6587
+ const WorldChainInterfaceCampaigns = {
6588
+ [WorldChainCampaigns.WorldChain_Vault_Re7USDC]: {
6589
+ campaignType: Campaign.MORPHO,
6590
+ subCampaignType: MorphoSubCampaignType.META,
6591
+ computeChainId: ChainId.WORLDCHAIN,
6592
+ targetToken: "0xb1E80387EbE53Ff75a89736097D34dC8D9E9045B",
6593
+ hooks: [],
6594
+ whitelist: [],
6595
+ blacklist: [],
6596
+ forwarders: [],
6597
+ },
6598
+ [WorldChainCampaigns.WorldChain_Vault_Re7WLD]: {
6599
+ campaignType: Campaign.MORPHO,
6600
+ subCampaignType: MorphoSubCampaignType.META,
6601
+ computeChainId: ChainId.WORLDCHAIN,
6602
+ targetToken: "0x348831b46876d3dF2Db98BdEc5E3B4083329Ab9f",
6603
+ hooks: [],
6604
+ whitelist: [],
6605
+ blacklist: [],
6606
+ forwarders: [],
6607
+ },
6608
+ [WorldChainCampaigns.WorldChain_Vault_Re7WETH]: {
6609
+ campaignType: Campaign.MORPHO,
6610
+ subCampaignType: MorphoSubCampaignType.META,
6611
+ computeChainId: ChainId.WORLDCHAIN,
6612
+ targetToken: "0x0Db7E405278c2674F462aC9D9eb8b8346D1c1571",
6613
+ hooks: [],
6614
+ whitelist: [],
6615
+ blacklist: [],
6616
+ forwarders: [],
6617
+ },
6618
+ [WorldChainCampaigns.WorldChain_MorphoBorrow_WLD_USDC]: {
6619
+ campaignType: Campaign.MORPHO,
6620
+ subCampaignType: MorphoSubCampaignType.BORROWING_BLUE,
6621
+ computeChainId: ChainId.WORLDCHAIN,
6622
+ marketId: "0xba0ae12a5cdbf9a458566be68055f30c859771612950b5e43428a51becc6f6e9",
6623
+ hooks: [],
6624
+ whitelist: [],
6625
+ blacklist: [],
6626
+ forwarders: [],
6627
+ },
6628
+ [WorldChainCampaigns.WorldChain_MorphoBorrow_WETH_USDC]: {
6629
+ campaignType: Campaign.MORPHO,
6630
+ subCampaignType: MorphoSubCampaignType.BORROWING_BLUE,
6631
+ computeChainId: ChainId.WORLDCHAIN,
6632
+ marketId: "0x5fadb14df6523eb13a939f8024dbc54b10bdb4e521741e9995e2951337134b53",
6633
+ hooks: [],
6634
+ whitelist: [],
6635
+ blacklist: [],
6636
+ forwarders: [],
6637
+ },
6638
+ [WorldChainCampaigns.WorldChain_MorphoBorrow_WBTC_USDC]: {
6639
+ campaignType: Campaign.MORPHO,
6640
+ subCampaignType: MorphoSubCampaignType.BORROWING_BLUE,
6641
+ computeChainId: ChainId.WORLDCHAIN,
6642
+ marketId: "0x787c5ff694f04e20cc6b3932cd662425161109bb0d63b189c48d99e714a3bd69",
6643
+ hooks: [],
6644
+ whitelist: [],
6645
+ blacklist: [],
6646
+ forwarders: [],
6647
+ },
6648
+ [WorldChainCampaigns.WorldChain_Vault_WORLDID_USDC]: {
6649
+ campaignType: Campaign.ERC20LOGPROCESSOR,
6650
+ computeChainId: ChainId.WORLDCHAIN,
6651
+ targetToken: "0xb1E80387EbE53Ff75a89736097D34dC8D9E9045B",
6652
+ hooks: [
6653
+ {
6654
+ hookType: HOOK.WORLDCHAINID,
6655
+ WorldIDAddressBook: "0x57b930D551e677CC36e2fA036Ae2fe8FdaE0330D",
6656
+ AddressBookChainId: ChainId.WORLDCHAIN,
6657
+ },
6658
+ ],
6659
+ whitelist: [],
6660
+ blacklist: [],
6661
+ forwarders: [],
6662
+ computeScoreParameters: {
6663
+ computeMethod: ComputeScoreMethod.maxDeposit,
6664
+ computeSettings: {
6665
+ maxDeposit: "250000000000000000000", // 250 * 1e18
6666
+ },
6667
+ },
6668
+ },
6669
+ [WorldChainCampaigns.WorldChain_Vault_WORLDID_WLD]: {
6670
+ campaignType: Campaign.ERC20LOGPROCESSOR,
6671
+ computeChainId: ChainId.WORLDCHAIN,
6672
+ targetToken: "0x348831b46876d3dF2Db98BdEc5E3B4083329Ab9f",
6673
+ hooks: [
6674
+ {
6675
+ hookType: HOOK.WORLDCHAINID,
6676
+ WorldIDAddressBook: "0x57b930D551e677CC36e2fA036Ae2fe8FdaE0330D",
6677
+ AddressBookChainId: ChainId.WORLDCHAIN,
6678
+ },
6679
+ ],
6680
+ whitelist: [],
6681
+ blacklist: [],
6682
+ forwarders: [],
6683
+ computeScoreParameters: {
6684
+ computeMethod: ComputeScoreMethod.maxDeposit,
6685
+ computeSettings: {
6686
+ maxDeposit: "250000000000000000000", // 250 * 1e18
6687
+ },
6688
+ },
6689
+ },
6690
+ };
6575
6691
  export const MerklInterfaceCampaigns = {
6576
6692
  [program.Puffer]: PufferInterfaceCampaigns,
6577
6693
  [program.ZkSync]: ZkSyncInterfaceCampaigns,
@@ -6587,4 +6703,5 @@ export const MerklInterfaceCampaigns = {
6587
6703
  [program.Ronin]: RoninInterfaceCampaigns,
6588
6704
  [program.TAC]: TACInterfaceCampaigns,
6589
6705
  [program.HypuurFi]: HypuurFiCampaignsInterface,
6706
+ [program.WorldChain]: WorldChainInterfaceCampaigns,
6590
6707
  };
@@ -680,6 +680,7 @@ export declare const v4: Elysia<"/v4", false, {
680
680
  id: string;
681
681
  };
682
682
  query: {
683
+ campaigns?: boolean | undefined;
683
684
  point?: boolean | undefined;
684
685
  test?: boolean | undefined;
685
686
  };
@@ -991,6 +992,7 @@ export declare const v4: Elysia<"/v4", false, {
991
992
  id: string;
992
993
  };
993
994
  query: {
995
+ campaigns?: boolean | undefined;
994
996
  point?: boolean | undefined;
995
997
  test?: boolean | undefined;
996
998
  };