@merkl/api 0.15.24 → 0.15.26

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 (28) hide show
  1. package/dist/src/backgroundJobs/jobs/campaignsCacheUpdater.js +14 -9
  2. package/dist/src/eden/index.d.ts +152 -15
  3. package/dist/src/entities/opportunity.js +3 -1
  4. package/dist/src/index.d.ts +40 -3
  5. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +1 -0
  6. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +2 -0
  7. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +1 -0
  8. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +2 -0
  9. package/dist/src/libs/campaigns/campaignTypes/HyperdriveDynamicData.js +51 -38
  10. package/dist/src/modules/v4/boost/boost.controller.d.ts +39 -0
  11. package/dist/src/modules/v4/boost/boost.controller.js +6 -1
  12. package/dist/src/modules/v4/boost/boost.service.d.ts +4 -0
  13. package/dist/src/modules/v4/boost/boost.service.js +23 -0
  14. package/dist/src/modules/v4/dynamicData/dynamicData.service.js +10 -3
  15. package/dist/src/modules/v4/opportunity/opportunity.service.js +1 -1
  16. package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +1 -3
  17. package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +1 -3
  18. package/dist/src/modules/v4/programPayload/programPayload.model.js +1 -3
  19. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +4 -1
  20. package/dist/src/modules/v4/programPayload/programPayload.repository.js +39 -0
  21. package/dist/src/modules/v4/programPayload/programPayload.service.js +6 -11
  22. package/dist/src/modules/v4/router.d.ts +40 -3
  23. package/dist/src/modules/v4/user/user.controller.js +5 -3
  24. package/dist/src/utils/decodeCalls.js +1 -0
  25. package/dist/src/utils/encodeCalls.js +1 -0
  26. package/dist/src/utils/generateCardName.js +4 -2
  27. package/dist/tsconfig.package.tsbuildinfo +1 -1
  28. package/package.json +1 -1
@@ -15,11 +15,9 @@ export declare const CampaignDataDto: import("@sinclair/typebox").TObject<{
15
15
  amount: import("@sinclair/typebox").TString;
16
16
  chainId: import("@sinclair/typebox").TNumber;
17
17
  computeChainId: import("@sinclair/typebox").TNumber;
18
- endTimestamp: import("@sinclair/typebox").TNumber;
18
+ duration: import("@sinclair/typebox").TNumber;
19
19
  rewardToken: import("@sinclair/typebox").TString;
20
20
  startTimestamp: import("@sinclair/typebox").TNumber;
21
- symbolRewardToken: import("@sinclair/typebox").TString;
22
- decimalsRewardToken: import("@sinclair/typebox").TNumber;
23
21
  }>;
24
22
  export declare const SinglePayloadInputDto: import("@sinclair/typebox").TObject<{
25
23
  distributionChainId: import("@sinclair/typebox").TNumber;
@@ -16,11 +16,9 @@ export const CampaignDataDto = t.Object({
16
16
  amount: t.String({ description: "Amount of the reward token to be distributed" }),
17
17
  chainId: t.Numeric({ description: "Chain ID where the reward tokens will be distributed" }),
18
18
  computeChainId: t.Numeric({ description: "Chain ID used for computation" }),
19
- endTimestamp: t.Numeric({ description: "End timestamp for the campaign" }),
19
+ duration: t.Numeric({ description: "Duration for the campaign" }),
20
20
  rewardToken: t.String({ description: "Address of the reward token to be distributed" }),
21
21
  startTimestamp: t.Numeric({ description: "Start timestamp for the campaign" }),
22
- symbolRewardToken: t.String({ description: "Symbol of the reward token" }),
23
- decimalsRewardToken: t.Numeric({ description: "Decimals of the reward token" }),
24
22
  });
25
23
  export const SinglePayloadInputDto = t.Object({
26
24
  distributionChainId: t.Numeric({ description: "Chain ID where the reward tokens will be distributed" }),
@@ -90,7 +90,9 @@ export declare enum pufferCampaigns {
90
90
  venus_pufeth = "0xE0ee5dDeBFe0abe0a4Af50299D68b74Cec31668e",
91
91
  unifiBTC = "0x170D847A8320F3B6A77eE15B0CAE430e3eC933a0",
92
92
  unifiUSD = "0x82c40e07277eBb92935f79cE92268F80dDc7caB4",
93
- CARROT_USDC = "0xf00032d0F95e8f43E750C51d0188DCa33cC5a8eA"
93
+ CARROT_USDC = "0xf00032d0F95e8f43E750C51d0188DCa33cC5a8eA",
94
+ sonex_pufETH_USDCe_1 = "0x4A0e0E8d5DF4AEC0a08359e599720628b179F7eD",
95
+ sonex_pufETH_USDCe_5 = "0x2646FAD13ef9BD063790d2719De1da290865D58f"
94
96
  }
95
97
  export declare enum zkSyncCampaigns {
96
98
  Izumi_Finance_Zk_Weth = "Izumi Finance ZK/WETH 0xd62bc9f19bd94fde9c41df4b6eb6419ea6b8e25c",
@@ -119,6 +121,7 @@ export declare enum zkSyncCampaigns {
119
121
  RFX_ZK_USD = "RFX ZK USD 0x9d4d54c8661a17604a46b849ded78cf20127fb92",
120
122
  RFX_ETH_USD = "RFX ETH USD 0x8efa54951bf70d9775dfe8f9364df83ad1e1a8cf",
121
123
  RFX_BTC_USD = "RFX BTC USD 0x62170af269e9acd09a89279c0485e89aa42857a3",
124
+ RFX_Vault_USN_USDCe = "RFX USN USDC.e 0x8D6E3e44FbE9A53564ED42b83961bb6f790C3063",
122
125
  Vest_USDC = "Vext USDC 0x7ccf5bbec69c790d27da3b5398b9e0d6d6eec9f3",
123
126
  Koi_Finance_ZK_WETH = "Koi Finance ZK/wETH Normal 1pct 0x58fb07e1fd51edd7bba91f870ff751e67e33cec5",
124
127
  Koi_Finance_USDCe_USDT = "Koi Finance USDC.e/USDT CL 0.01pct 0x57cc53def9f5ca7ef4da51082dd874867e56ba14",
@@ -95,6 +95,8 @@ export var pufferCampaigns;
95
95
  pufferCampaigns["unifiBTC"] = "0x170D847A8320F3B6A77eE15B0CAE430e3eC933a0";
96
96
  pufferCampaigns["unifiUSD"] = "0x82c40e07277eBb92935f79cE92268F80dDc7caB4";
97
97
  pufferCampaigns["CARROT_USDC"] = "0xf00032d0F95e8f43E750C51d0188DCa33cC5a8eA";
98
+ pufferCampaigns["sonex_pufETH_USDCe_1"] = "0x4A0e0E8d5DF4AEC0a08359e599720628b179F7eD";
99
+ pufferCampaigns["sonex_pufETH_USDCe_5"] = "0x2646FAD13ef9BD063790d2719De1da290865D58f";
98
100
  })(pufferCampaigns || (pufferCampaigns = {}));
99
101
  export var zkSyncCampaigns;
100
102
  (function (zkSyncCampaigns) {
@@ -124,6 +126,7 @@ export var zkSyncCampaigns;
124
126
  zkSyncCampaigns["RFX_ZK_USD"] = "RFX ZK USD 0x9d4d54c8661a17604a46b849ded78cf20127fb92";
125
127
  zkSyncCampaigns["RFX_ETH_USD"] = "RFX ETH USD 0x8efa54951bf70d9775dfe8f9364df83ad1e1a8cf";
126
128
  zkSyncCampaigns["RFX_BTC_USD"] = "RFX BTC USD 0x62170af269e9acd09a89279c0485e89aa42857a3";
129
+ zkSyncCampaigns["RFX_Vault_USN_USDCe"] = "RFX USN USDC.e 0x8D6E3e44FbE9A53564ED42b83961bb6f790C3063";
127
130
  zkSyncCampaigns["Vest_USDC"] = "Vext USDC 0x7ccf5bbec69c790d27da3b5398b9e0d6d6eec9f3";
128
131
  zkSyncCampaigns["Koi_Finance_ZK_WETH"] = "Koi Finance ZK/wETH Normal 1pct 0x58fb07e1fd51edd7bba91f870ff751e67e33cec5";
129
132
  zkSyncCampaigns["Koi_Finance_USDCe_USDT"] = "Koi Finance USDC.e/USDT CL 0.01pct 0x57cc53def9f5ca7ef4da51082dd874867e56ba14";
@@ -1936,6 +1939,16 @@ const ZkSyncInterfaceCampaigns = {
1936
1939
  url: "https://app.rfx.exchange/earn?market=0x9D4d54c8661a17604A46B849DED78Cf20127fB92",
1937
1940
  forwarders: [],
1938
1941
  },
1942
+ [zkSyncCampaigns.RFX_Vault_USN_USDCe]: {
1943
+ campaignType: Campaign.ERC20,
1944
+ computeChainId: ChainId.ZKSYNC,
1945
+ hooks: [],
1946
+ targetToken: "0x233122C668f6433c0ee5C47A003EEf81c1cc972c",
1947
+ whitelist: [],
1948
+ blacklist: ["0x233122C668f6433c0ee5C47A003EEf81c1cc972c"],
1949
+ url: "https://app.rfx.exchange/vault",
1950
+ forwarders: [],
1951
+ },
1939
1952
  [zkSyncCampaigns.HoldSation_USDC]: {
1940
1953
  campaignType: Campaign.ERC20,
1941
1954
  computeChainId: ChainId.ZKSYNC,
@@ -3337,6 +3350,32 @@ const PufferInterfaceCampaigns = {
3337
3350
  weightToken0: 5000,
3338
3351
  weightToken1: 5000,
3339
3352
  },
3353
+ [pufferCampaigns.sonex_pufETH_USDCe_1]: {
3354
+ campaignType: Campaign.CLAMM,
3355
+ computeChainId: ChainId.SONEIUM,
3356
+ poolAddress: "0x4A0e0E8d5DF4AEC0a08359e599720628b179F7eD",
3357
+ hooks: [],
3358
+ whitelist: [],
3359
+ blacklist: [],
3360
+ url: "https://app.sonex.so/explore/pools/0x4A0e0E8d5DF4AEC0a08359e599720628b179F7eD",
3361
+ isOutOfRangeIncentivized: false,
3362
+ weightFees: 0,
3363
+ weightToken0: 5000,
3364
+ weightToken1: 5000,
3365
+ },
3366
+ [pufferCampaigns.sonex_pufETH_USDCe_5]: {
3367
+ campaignType: Campaign.CLAMM,
3368
+ computeChainId: ChainId.SONEIUM,
3369
+ poolAddress: "0x2646FAD13ef9BD063790d2719De1da290865D58f",
3370
+ hooks: [],
3371
+ whitelist: [],
3372
+ blacklist: [],
3373
+ url: "https://app.sonex.so/explore/pools/0x2646FAD13ef9BD063790d2719De1da290865D58f",
3374
+ isOutOfRangeIncentivized: false,
3375
+ weightFees: 0,
3376
+ weightToken0: 5000,
3377
+ weightToken1: 5000,
3378
+ },
3340
3379
  [pufferCampaigns.uniswapv3_weth_PUFFER]: {
3341
3380
  campaignType: Campaign.CLAMM,
3342
3381
  computeChainId: ChainId.MAINNET,
@@ -1,4 +1,4 @@
1
- import { CampaignTypeConfigResourceMapping, ChainId, NULL_ADDRESS, NULL_ROOT, ParserService, buildCampaignPayload, encodeForwarderData, registry, } from "@sdk";
1
+ import { CampaignTypeConfigResourceMapping, ChainId, NULL_ADDRESS, NULL_ROOT, buildCampaignPayload, encodeForwarderData, parseCampaign, registry, } from "@sdk";
2
2
  import _ from "lodash";
3
3
  import { safeTemplate, } from "./programPayload.model";
4
4
  import { MerklInterfaceCampaigns } from "./programPayload.repository";
@@ -176,24 +176,19 @@ export class ProgramPayloadService {
176
176
  return campaignPayloads;
177
177
  }
178
178
  static async buildConfigFromCampaignData(body) {
179
- const parser = ParserService(body.campaignType);
180
179
  const base = {
181
- amount: body.amount,
182
180
  campaignId: "0xdefaultId",
183
- campaignSubType: 0,
184
- campaignType: body.campaignType,
185
- chainId: body.chainId,
186
- computeChainId: body.computeChainId,
187
181
  creator: "Oxcreator",
188
- endTimestamp: body.endTimestamp,
189
- index: 0,
190
- mainParameter: " ".repeat(42),
191
182
  rewardToken: body.rewardToken,
183
+ amount: body.amount,
184
+ campaignType: body.campaignType,
192
185
  startTimestamp: body.startTimestamp,
186
+ duration: body.duration,
187
+ campaignData: body.campaignData,
193
188
  };
194
189
  try {
195
190
  console.log("Parsing campaign data");
196
- const res = await parser.parse(body.chainId, body.symbolRewardToken, body.decimalsRewardToken, base, body.campaignData);
191
+ const res = await parseCampaign(body.chainId, base, 0);
197
192
  if (res.success) {
198
193
  return res;
199
194
  }
@@ -3505,14 +3505,12 @@ export declare const v4: Elysia<"/v4", false, {
3505
3505
  body: {
3506
3506
  chainId: number;
3507
3507
  startTimestamp: number;
3508
- endTimestamp: number;
3509
3508
  computeChainId: number;
3510
3509
  amount: string;
3511
3510
  rewardToken: string;
3512
3511
  campaignType: number;
3512
+ duration: number;
3513
3513
  campaignData: string;
3514
- symbolRewardToken: string;
3515
- decimalsRewardToken: number;
3516
3514
  };
3517
3515
  params: {};
3518
3516
  query: unknown;
@@ -3568,6 +3566,45 @@ export declare const v4: Elysia<"/v4", false, {
3568
3566
  };
3569
3567
  };
3570
3568
  };
3569
+ } & {
3570
+ boosts: {
3571
+ openBlock: {
3572
+ post: {
3573
+ body: {
3574
+ addresses: string[];
3575
+ } | {
3576
+ address: string;
3577
+ score: string;
3578
+ }[];
3579
+ params: {};
3580
+ query: unknown;
3581
+ headers: unknown;
3582
+ response: {
3583
+ 200: {
3584
+ address: string;
3585
+ boost: string;
3586
+ }[];
3587
+ };
3588
+ };
3589
+ };
3590
+ };
3591
+ } & {
3592
+ boosts: {
3593
+ openBlock: {
3594
+ get: {
3595
+ body: unknown;
3596
+ params: {};
3597
+ query: unknown;
3598
+ headers: unknown;
3599
+ response: {
3600
+ 200: {
3601
+ address: string;
3602
+ boost: string;
3603
+ }[];
3604
+ };
3605
+ };
3606
+ };
3607
+ };
3571
3608
  };
3572
3609
  } & {
3573
3610
  v4: {
@@ -10,9 +10,11 @@ export const UserController = new Elysia({ prefix: "/users", detail: { tags: ["U
10
10
  // ─── Get Many Users ──────────────────────────────────────────────────
11
11
  .get("/", async ({ query }) => await UserService.findMany(query), { query: GetManyUserQuery, detail: { hide: true } })
12
12
  // ─── Get All Tagged Users ─────────────────────────────────────────────
13
- .get("/tags", async () => {
14
- return await UserService.findManyWithTags();
15
- }, { headers: AuthorizationHeadersDto, beforeHandle: BackOfficeGuard, detail: { hide: true } })
13
+ .get("/tags", async () => await UserService.findManyWithTags(), {
14
+ headers: AuthorizationHeadersDto,
15
+ beforeHandle: BackOfficeGuard,
16
+ detail: { hide: true },
17
+ })
16
18
  // ─── Get A User By Address ───────────────────────────────────────────
17
19
  .get("/:address", async ({ params }) => await UserService.findUnique(params.address), {
18
20
  detail: { hide: true },
@@ -191,6 +191,7 @@ export function decodeReturnValue(returnData, key, type) {
191
191
  switch (type) {
192
192
  case tokenType.anglesLiquid:
193
193
  case tokenType.cian:
194
+ case tokenType.rfx_slv:
194
195
  return ERC4626Interface.decodeFunctionResult("totalAssets", returnData)[0];
195
196
  case tokenType.concrete:
196
197
  return ERC4626Interface.decodeFunctionResult("totalAssets", returnData)[0];
@@ -247,6 +247,7 @@ export function createCall(target, key, type, metaData) {
247
247
  switch (type) {
248
248
  case tokenType.anglesLiquid:
249
249
  case tokenType.cian:
250
+ case tokenType.rfx_slv:
250
251
  return {
251
252
  allowFailure: true,
252
253
  callData: ERC4626Interface.encodeFunctionData("totalAssets"),
@@ -134,14 +134,16 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
134
134
  case tokenType.concrete:
135
135
  case tokenType.cian:
136
136
  return `Deposit ${typeInfo.symbolAsset} into ${typeInfo.name.replace("Ether.Fi", "Veda")}`;
137
+ case tokenType.rfx_slv:
138
+ return `Deposit ${typeInfo.symbolAsset} into ${typeInfo.name}`;
137
139
  case tokenType.equalizer_gauge:
138
140
  return `${displayName}`;
139
141
  case tokenType.anglesLiquid:
140
142
  return `Deposit into ${typeInfo.name} (${campaign.campaignParameters.symbolTargetToken}) Vault`;
141
143
  case tokenType.spectra_lpt:
142
- return `Provide liquidity to ${typeInfo.name}`;
144
+ return `Provide liquidity on Spectra to ${typeInfo.name}`;
143
145
  case tokenType.spectra_yt:
144
- return `Hold ${typeInfo.name}`;
146
+ return `Hold Spectra ${typeInfo.name}`;
145
147
  default:
146
148
  // OVERRIDE
147
149
  switch (typeInfo.tokenAddress) {