@merkl/api 0.19.15 → 0.19.17

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.
@@ -65,6 +65,9 @@ export class ClammMetadata {
65
65
  }
66
66
  }
67
67
  }
68
+ const mainProtocol = AMM[params.amm]
69
+ ? camelToKebabCase(AMM[params.amm].replace(/\/?(V\d+)/g, "").replaceAll("Algebra", ""))
70
+ : undefined;
68
71
  return {
69
72
  name: `Provide liquidity to ${whitelistNameString} ${platform} ${params.symbolToken0}-${params.symbolToken1}${params.poolFee ? ` ${params.poolFee}%` : ""}`,
70
73
  action: OpportunityAction.POOL,
@@ -72,7 +75,7 @@ export class ClammMetadata {
72
75
  { chainId: computeChainId, address: params.token0 },
73
76
  { chainId: computeChainId, address: params.token1 },
74
77
  ],
75
- mainProtocol: AMM[params.amm] ? camelToKebabCase(AMM[params.amm]) : undefined,
78
+ mainProtocol,
76
79
  depositUrl: ClammMetadata.generateUrl(computeChainId, params),
77
80
  };
78
81
  }
@@ -79,4 +79,11 @@ async function main() {
79
79
  .replace("@merkl.xyz", "");
80
80
  await assignRole(notionId);
81
81
  }
82
- await main();
82
+ try {
83
+ await main();
84
+ process.exit(0);
85
+ }
86
+ catch (err) {
87
+ console.error(err);
88
+ process.exit(1);
89
+ }
@@ -95,30 +95,6 @@ export declare abstract class OpportunityService {
95
95
  apr: number;
96
96
  dailyRewards: number;
97
97
  }>;
98
- static updateStatusFromCampaign(campaign: Omit<CreateCampaignModel, "id">, upsert?: boolean): Promise<{
99
- id: string;
100
- chainId: number;
101
- type: string;
102
- identifier: string;
103
- name: string;
104
- status: "PAST" | "LIVE" | "SOON";
105
- action: OpportunityAction;
106
- tokens: {
107
- price?: number | null | undefined;
108
- symbol: string;
109
- id: string;
110
- name: string | null;
111
- icon: string;
112
- address: string;
113
- chainId: number;
114
- decimals: number;
115
- verified: boolean;
116
- isTest: boolean;
117
- }[];
118
- mainProtocol: string | undefined;
119
- depositUrl: string | undefined;
120
- tags: string[];
121
- }>;
122
98
  /**
123
99
  * deletes and recreates an opportunity with fresh data
124
100
  */
@@ -124,36 +124,6 @@ export class OpportunityService {
124
124
  static async updateStatus(opportunityId, status) {
125
125
  return await OpportunityRepository.update(opportunityId, { status });
126
126
  }
127
- static async updateStatusFromCampaign(campaign, upsert = true) {
128
- const campaignType = CampaignService.getTypeFromV3(campaign.type);
129
- const metadata = await OpportunityService.#getMetadata(campaign);
130
- const opportunityId = OpportunityService.hashId({
131
- chainId: campaign.computeChainId,
132
- identifier: campaign.opportunityIdentifier,
133
- type: campaignType,
134
- });
135
- const currentOpportunity = await OpportunityService.getUniqueOrThrow(opportunityId, true);
136
- const now = moment().unix();
137
- const opportunity = {
138
- id: opportunityId,
139
- chainId: campaign.computeChainId,
140
- type: campaignType,
141
- identifier: campaign.opportunityIdentifier, // mainParameter
142
- name: currentOpportunity.name,
143
- status: now >= +campaign.startTimestamp && now < +campaign.endTimestamp
144
- ? Status.LIVE
145
- : now > +campaign.endTimestamp
146
- ? Status.PAST
147
- : Status.SOON,
148
- action: metadata.action,
149
- tokens: currentOpportunity.tokens,
150
- mainProtocol: metadata.mainProtocol,
151
- depositUrl: currentOpportunity.depositUrl,
152
- tags: currentOpportunity.tags,
153
- };
154
- await OpportunityRepository.create(opportunity, upsert);
155
- return opportunity;
156
- }
157
127
  /**
158
128
  * deletes and recreates an opportunity with fresh data
159
129
  */
@@ -9,7 +9,7 @@ export type Protocol = Resource<"Protocol", undefined, {
9
9
  numberOfLiveCampaigns?: number;
10
10
  opportunityLiveTags?: string[];
11
11
  }>;
12
- declare const protocolTypes: readonly ["uniswap", "ambient", "arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap", "quickswap", "ramses", "retro", "stryke", "sushiswap", "swapr", "thruster", "voltage", "zero", "koi", "supswap", "zkswap", "thirdtrade", "velodrome", "aerodrome", "balancer", "curve", "cross_curve", "curveNPool", "aura", "akron", "beefy", "dragonswap", "poolside", "koi", "syncswap", "neptune", "zkSwapThreePool", "syncswap", "rfx", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank", "ion", "venus", "woofi", "reactor_fusion", "eigenlayer", "vest", "zerolend", "hyperdrive", "gamma", "oku", "hourglass", "veda", "kyo", "sonex", "quickswap-algebra", "velodrome"];
12
+ declare const protocolTypes: readonly ["uniswap", "ambient", "arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap", "quickswap", "ramses", "retro", "stryke", "sushiswap", "swapr", "thruster", "voltage", "zero", "koi", "supswap", "zkswap", "thirdtrade", "velodrome", "aerodrome", "balancer", "curve", "cross_curve", "curveNPool", "aura", "akron", "beefy", "dragonswap", "poolside", "koi", "syncswap", "neptune", "zkSwapThreePool", "syncswap", "rfx", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank", "ion", "venus", "woofi", "reactor_fusion", "eigenlayer", "vest", "zerolend", "hyperdrive", "gamma", "oku", "hourglass", "veda", "kyo", "sonex", "velodrome"];
13
13
  export type ProtocolId = (typeof protocolTypes)[number];
14
14
  export declare const ProtocolResourceDto: import("@sinclair/typebox").TObject<{
15
15
  id: import("@sinclair/typebox").TString;
@@ -75,7 +75,6 @@ const protocolTypes = [
75
75
  "veda",
76
76
  "kyo",
77
77
  "sonex",
78
- "quickswap-algebra",
79
78
  "velodrome",
80
79
  ];
81
80
  // ─── DTOs ────────────────────────────────────────────────────────────────────