@merkl/api 0.16.31 → 0.16.33

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 (39) hide show
  1. package/dist/src/eden/index.d.ts +308 -63
  2. package/dist/src/index.d.ts +64 -19
  3. package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +6 -2
  4. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/GenericProcessor.d.ts +16 -1
  5. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/GenericProcessor.js +84 -10
  6. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/ownerFinder.js +1 -0
  7. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +2 -2
  8. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +3 -3
  9. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/HanjiVaultProcessor.d.ts +43 -0
  10. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/HanjiVaultProcessor.js +58 -0
  11. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/curveNPoolProcessor.js +0 -1
  12. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/processorMapping.js +2 -2
  13. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.d.ts +1 -1
  14. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +17 -19
  15. package/dist/src/libs/campaigns/campaignTypes/RadiantDynamicData.js +13 -2
  16. package/dist/src/modules/v4/boost/boost.controller.d.ts +0 -19
  17. package/dist/src/modules/v4/boost/boost.controller.js +1 -2
  18. package/dist/src/modules/v4/boost/boost.service.d.ts +0 -4
  19. package/dist/src/modules/v4/boost/boost.service.js +0 -23
  20. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +64 -0
  21. package/dist/src/modules/v4/campaign/campaign.controller.js +20 -0
  22. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +37 -0
  23. package/dist/src/modules/v4/campaign/campaign.repository.js +7 -0
  24. package/dist/src/modules/v4/campaign/campaign.service.d.ts +37 -0
  25. package/dist/src/modules/v4/opportunity/opportunity.service.js +1 -1
  26. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +69 -318
  27. package/dist/src/modules/v4/programPayload/programPayload.repository.js +237 -54
  28. package/dist/src/modules/v4/router.d.ts +64 -19
  29. package/dist/src/utils/decodeCalls.js +7 -1
  30. package/dist/src/utils/encodeCalls.js +17 -1
  31. package/dist/src/utils/generateCardName.d.ts +3 -0
  32. package/dist/src/utils/generateCardName.js +25 -3
  33. package/dist/src/utils/generateIcons.js +5 -0
  34. package/dist/tsconfig.package.tsbuildinfo +1 -1
  35. package/package.json +1 -1
  36. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/StakingProcessor.d.ts +0 -41
  37. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/StakingProcessor.js +0 -70
  38. package/dist/src/libs/campaigns/utils/getLastEligibilityRatio.d.ts +0 -2
  39. package/dist/src/libs/campaigns/utils/getLastEligibilityRatio.js +0 -65
@@ -1029,6 +1029,70 @@ export declare const v4: Elysia<"/v4", false, {
1029
1029
  };
1030
1030
  };
1031
1031
  };
1032
+ } & {
1033
+ ":id": {
1034
+ get: {
1035
+ body: unknown;
1036
+ params: {
1037
+ id: string;
1038
+ };
1039
+ query: unknown;
1040
+ headers: unknown;
1041
+ response: {
1042
+ 200: {
1043
+ params: any;
1044
+ chain: {
1045
+ name: string;
1046
+ id: number;
1047
+ icon: string;
1048
+ };
1049
+ rewardToken: {
1050
+ symbol: string;
1051
+ name: string | null;
1052
+ id: string;
1053
+ icon: string;
1054
+ chainId: number;
1055
+ address: string;
1056
+ decimals: number;
1057
+ verified: boolean;
1058
+ isTest: boolean;
1059
+ } & {
1060
+ price?: number | null | undefined;
1061
+ };
1062
+ distributionChain: {
1063
+ name: string;
1064
+ id: number;
1065
+ icon: string;
1066
+ } | undefined;
1067
+ campaignStatus: {
1068
+ error: string;
1069
+ details: import("database/api/.generated/runtime/library").JsonValue;
1070
+ status: import("../../../database/api/.generated").$Enums.RunStatus;
1071
+ campaignId: string;
1072
+ computedUntil: bigint;
1073
+ processingStarted: bigint;
1074
+ };
1075
+ creatorAddress: string;
1076
+ Creator: {
1077
+ tags: string[];
1078
+ address: string;
1079
+ creatorId: string | null;
1080
+ };
1081
+ type: string;
1082
+ id: string;
1083
+ subType: number | null;
1084
+ startTimestamp: bigint;
1085
+ endTimestamp: bigint;
1086
+ computeChainId: number;
1087
+ distributionChainId: number;
1088
+ campaignId: string;
1089
+ rewardTokenId: string;
1090
+ amount: string;
1091
+ opportunityId: string;
1092
+ };
1093
+ };
1094
+ };
1095
+ };
1032
1096
  } & {
1033
1097
  count: {
1034
1098
  get: {
@@ -3701,25 +3765,6 @@ export declare const v4: Elysia<"/v4", false, {
3701
3765
  };
3702
3766
  };
3703
3767
  };
3704
- } & {
3705
- boosts: {
3706
- openblock: {
3707
- zksync: {
3708
- get: {
3709
- body: unknown;
3710
- params: {};
3711
- query: unknown;
3712
- headers: unknown;
3713
- response: {
3714
- 200: {
3715
- address: string;
3716
- boost: string;
3717
- }[];
3718
- };
3719
- };
3720
- };
3721
- };
3722
- };
3723
3768
  };
3724
3769
  } & {
3725
3770
  v4: {
@@ -1,4 +1,4 @@
1
- import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerV3StablePoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, HourglassERC20TBTInterface, HourglassVedaLockDepositorV2Interface, IonicInterface, LayerBankERC20Interface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
1
+ import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerV3StablePoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, HourglassERC20TBTInterface, HourglassVedaLockDepositorV2Interface, IonicInterface, LPManagerHelperInterface, LPManagerInterface, LayerBankERC20Interface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
2
2
  import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
3
3
  export function decodeCall(calls, index, key, type) {
4
4
  const returnData = calls[index];
@@ -6,6 +6,12 @@ export function decodeCall(calls, index, key, type) {
6
6
  }
7
7
  export function decodeReturnValue(returnData, key, type) {
8
8
  switch (key) {
9
+ case "tokens":
10
+ return LPManagerInterface.decodeFunctionResult("tokens", returnData)[0];
11
+ case "getTokensCount":
12
+ return LPManagerInterface.decodeFunctionResult("getTokensCount", returnData)[0];
13
+ case "getTotalValue":
14
+ return LPManagerHelperInterface.decodeFunctionResult("getTotalValue", returnData)[0];
9
15
  case "domain":
10
16
  return CurveStableSwapNGInterface.decodeFunctionResult("DOMAIN_SEPARATOR", returnData)[0];
11
17
  case "SY":
@@ -1,7 +1,17 @@
1
1
  import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
- import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerV3StablePoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, HourglassERC20TBTInterface, HourglassVedaLockDepositorV2Interface, IonicInterface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, } from "@sdk";
2
+ import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerV3StablePoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, HourglassERC20TBTInterface, HourglassVedaLockDepositorV2Interface, IonicInterface, LPManagerHelperInterface, LPManagerInterface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, } from "@sdk";
3
3
  export function createCall(target, key, type, metaData) {
4
4
  switch (key) {
5
+ case "tokens":
6
+ return { allowFailure: true, callData: LPManagerInterface.encodeFunctionData("tokens", [metaData]), target };
7
+ case "getTokensCount":
8
+ return { allowFailure: true, callData: LPManagerInterface.encodeFunctionData("getTokensCount"), target };
9
+ case "getTotalValue":
10
+ return {
11
+ allowFailure: true,
12
+ callData: LPManagerHelperInterface.encodeFunctionData("getTotalValue", [metaData]),
13
+ target,
14
+ };
5
15
  case "SY":
6
16
  return { allowFailure: true, callData: PendleYTInterface.encodeFunctionData("SY"), target };
7
17
  case "collateralContract":
@@ -183,6 +193,12 @@ export function createCall(target, key, type, metaData) {
183
193
  callData: ERC20Interface.encodeFunctionData("symbol"),
184
194
  target,
185
195
  };
196
+ case "name":
197
+ return {
198
+ allowFailure: true,
199
+ callData: ERC20Interface.encodeFunctionData("name"),
200
+ target,
201
+ };
186
202
  case "decimals":
187
203
  return {
188
204
  allowFailure: true,
@@ -1,3 +1,6 @@
1
1
  import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
2
  import { type Campaign, type CampaignParameters } from "@sdk";
3
+ export declare const stakingContractToStakingSymbol: {
4
+ [key: string]: string;
5
+ };
3
6
  export declare function generateCardName(type: tokenType, typeInfo: any, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, symbols?: string[], displayName?: string): string;
@@ -1,6 +1,28 @@
1
1
  import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
2
  import { ChainId } from "@sdk";
3
+ export const stakingContractToStakingSymbol = {
4
+ "0x18eeD20f71BEf84B605253C89A7576E3634134C0": "CyberStaking",
5
+ "0x68754d29f2e97B837Cb622ccfF325adAC27E9977": "Karak",
6
+ "0xcd28cF8f7755f03967D27E128B38022B63919836": "Llamalend",
7
+ };
3
8
  export function generateCardName(type, typeInfo, campaign, symbols = [""], displayName) {
9
+ if (typeInfo.isStaking === "true") {
10
+ if (typeInfo.stakingName !== undefined) {
11
+ typeInfo.stakingSymbol = typeInfo.stakingName.includes("Deposit")
12
+ ? typeInfo.stakingName.replace("Deposit", "").trim()
13
+ : typeInfo.stakingName;
14
+ }
15
+ if (typeInfo.stakingSymbol === undefined) {
16
+ typeInfo.stakingSymbol = typeInfo.eip712DomainName;
17
+ }
18
+ if (typeInfo.stakingSymbol === undefined) {
19
+ typeInfo.stakingSymbol = typeInfo.protocol !== "Unknown" ? typeInfo.protocol : undefined;
20
+ }
21
+ if (typeInfo.stakingSymbol === undefined) {
22
+ typeInfo.stakingSymbol = stakingContractToStakingSymbol[typeInfo.stakingContract];
23
+ }
24
+ return `${typeInfo.lockNFT !== undefined ? "Lock" : "Stake"} ${campaign.campaignParameters.symbolTargetToken} on ${typeInfo.stakingSymbol}`;
25
+ }
4
26
  switch (type) {
5
27
  case tokenType.uniswapv2:
6
28
  case tokenType.poolside:
@@ -121,8 +143,6 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
121
143
  return `Deposit into ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} vault on ${typeInfo.protocol}`;
122
144
  case tokenType.holdstation:
123
145
  return `Hold vault token ${campaign.campaignParameters.symbolTargetToken} on ${typeInfo.protocol}`;
124
- case tokenType.staking:
125
- return `${typeInfo.lockNFT !== undefined ? "Lock" : "Stake"} ${campaign.campaignParameters.symbolTargetToken} on ${typeInfo.stakingSymbol}`;
126
146
  case tokenType.cpmmGamma:
127
147
  return `Provide ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} on ${typeInfo.protocol}`;
128
148
  case tokenType.crosscurve:
@@ -136,7 +156,7 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
136
156
  const parsedName = typeInfo.name.split(" ");
137
157
  parsedName.shift();
138
158
  const parsedNameForCard = parsedName.join(" ");
139
- return `Deposit liquidity on ${parsedNameForCard.replace("BALANCER", "Beets")} vault on Vicuna Finance`;
159
+ return `Deposit liquidity on ${parsedNameForCard.replace("BALANCER", "Beets")} vault on Vicuna`;
140
160
  }
141
161
  case tokenType.satlayer:
142
162
  return `Restake ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
@@ -157,6 +177,8 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
157
177
  return `Hold Spectra ${typeInfo.name}`;
158
178
  case tokenType.hourglass:
159
179
  return `Deposit ${typeInfo.symbolUnderlyingToken} into Hourglass`;
180
+ case tokenType.hanji_liquidity_vault_token:
181
+ return "Provide Liquidity on Hanji Vault";
160
182
  default:
161
183
  // OVERRIDE
162
184
  switch (typeInfo.tokenAddress) {
@@ -5,6 +5,10 @@ export function generateIcons(type, typeInfo, campaign, symbols = [""]) {
5
5
  switch (action) {
6
6
  case OpportunityAction.POOL:
7
7
  switch (type) {
8
+ case tokenType.vicuna: {
9
+ const parsedName = typeInfo.name.split(" ").pop();
10
+ return parsedName.split("-");
11
+ }
8
12
  case tokenType.balancerGauge:
9
13
  case tokenType.balancerPool:
10
14
  case tokenType.aura:
@@ -13,6 +17,7 @@ export function generateIcons(type, typeInfo, campaign, symbols = [""]) {
13
17
  .filter(tkn => tkn && !tkn.includes("/"));
14
18
  case tokenType.curve:
15
19
  case tokenType.curve_2:
20
+ case tokenType.hanji_liquidity_vault_token:
16
21
  case tokenType.crosscurve: {
17
22
  const icons = [];
18
23
  for (let i = 0; i < typeInfo.numberTokens; i++) {