@merkl/api 0.19.21 → 0.19.23

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 (55) hide show
  1. package/dist/src/eden/index.d.ts +55 -55
  2. package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.js +2 -2
  3. package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.d.ts +5 -5
  4. package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.js +103 -94
  5. package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.d.ts +1 -1
  6. package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +7 -9
  7. package/dist/src/engine/opportunityMetadata/implementations/Ajna.d.ts +2 -1
  8. package/dist/src/engine/opportunityMetadata/implementations/Ambient.d.ts +2 -1
  9. package/dist/src/engine/opportunityMetadata/implementations/Badger.d.ts +2 -1
  10. package/dist/src/engine/opportunityMetadata/implementations/Clamm.d.ts +2 -1
  11. package/dist/src/engine/opportunityMetadata/implementations/Clamm.js +17 -4
  12. package/dist/src/engine/opportunityMetadata/implementations/Compound.js +2 -1
  13. package/dist/src/engine/opportunityMetadata/implementations/Default.d.ts +0 -1
  14. package/dist/src/engine/opportunityMetadata/implementations/Default.js +0 -1
  15. package/dist/src/engine/opportunityMetadata/implementations/Dolomite.d.ts +2 -1
  16. package/dist/src/engine/opportunityMetadata/implementations/EigenLayer.d.ts +2 -1
  17. package/dist/src/engine/opportunityMetadata/implementations/Encompassing.js +5 -0
  18. package/dist/src/engine/opportunityMetadata/implementations/Erc20.js +5 -0
  19. package/dist/src/engine/opportunityMetadata/implementations/Euler.d.ts +2 -1
  20. package/dist/src/engine/opportunityMetadata/implementations/EventBased.d.ts +1 -1
  21. package/dist/src/engine/opportunityMetadata/implementations/EventBased.js +7 -6
  22. package/dist/src/engine/opportunityMetadata/implementations/Hyperdrive.d.ts +2 -1
  23. package/dist/src/engine/opportunityMetadata/implementations/Ion.d.ts +2 -1
  24. package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.d.ts +2 -2
  25. package/dist/src/engine/opportunityMetadata/implementations/Morpho.d.ts +2 -1
  26. package/dist/src/engine/opportunityMetadata/implementations/Radiant.d.ts +2 -1
  27. package/dist/src/engine/opportunityMetadata/implementations/Silo.d.ts +2 -1
  28. package/dist/src/engine/opportunityMetadata/implementations/UniswapV4.d.ts +2 -1
  29. package/dist/src/engine/opportunityMetadata/implementations/Vest.d.ts +2 -1
  30. package/dist/src/index.d.ts +11 -11
  31. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +1 -1
  32. package/dist/src/modules/v4/enso/enso.model.d.ts +2 -2
  33. package/dist/src/modules/v4/enso/enso.model.js +2 -2
  34. package/dist/src/modules/v4/interaction/interaction.model.d.ts +1 -1
  35. package/dist/src/modules/v4/interaction/interaction.model.js +3 -3
  36. package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +4 -4
  37. package/dist/src/modules/v4/kyberzap/kyberzap.model.js +4 -4
  38. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1 -1
  39. package/dist/src/modules/v4/opportunity/opportunity.repository.js +62 -4
  40. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +3 -3
  41. package/dist/src/modules/v4/protocol/protocol.model.d.ts +2 -3
  42. package/dist/src/modules/v4/protocol/protocol.model.js +49 -9
  43. package/dist/src/modules/v4/protocol/protocol.repository.js +12 -0
  44. package/dist/src/modules/v4/protocol/protocol.service.js +20 -4
  45. package/dist/src/modules/v4/router.d.ts +11 -11
  46. package/dist/src/modules/v4/token/token.controller.d.ts +9 -9
  47. package/dist/src/modules/v4/token/token.model.d.ts +5 -5
  48. package/dist/src/modules/v4/token/token.model.js +7 -5
  49. package/dist/src/modules/v4/token/token.service.js +5 -5
  50. package/dist/src/utils/caseChanges.d.ts +1 -0
  51. package/dist/src/utils/caseChanges.js +3 -0
  52. package/dist/tsconfig.package.tsbuildinfo +1 -1
  53. package/package.json +1 -1
  54. package/dist/database/api/seeder/resources/protocol.d.ts +0 -373
  55. package/dist/database/api/seeder/resources/protocol.js +0 -344
@@ -121,9 +121,12 @@ export class OpportunityRepository {
121
121
  };
122
122
  }
123
123
  static async create(newOpp, upsert = false) {
124
- const opportunity = await apiDbClient.opportunity.findUnique({ where: { id: newOpp.id } });
125
- if (!!opportunity && !upsert) {
126
- return opportunity;
124
+ const previousOpportunity = await apiDbClient.opportunity.findUnique({
125
+ where: { id: newOpp.id },
126
+ include: { Tokens: true, Protocols: true },
127
+ });
128
+ if (!!previousOpportunity && !upsert) {
129
+ return previousOpportunity;
127
130
  }
128
131
  if (!!newOpp.mainProtocol) {
129
132
  let mainProtocol = await apiDbClient.protocol.findUnique({ where: { id: newOpp.mainProtocol } });
@@ -147,6 +150,25 @@ export class OpportunityRepository {
147
150
  if (mainProtocol.tags.includes("LENDING") && !!newOpp.name && newOpp.name.includes("Supply"))
148
151
  newOpp.action = "LEND";
149
152
  }
153
+ const toDisconnect = {
154
+ protocols: [],
155
+ tokens: [],
156
+ };
157
+ if (!!previousOpportunity) {
158
+ for (const protocol of previousOpportunity.Protocols) {
159
+ if (!newOpp.protocols || !newOpp.protocols.includes(protocol.id)) {
160
+ toDisconnect.protocols.push(protocol.id);
161
+ }
162
+ }
163
+ for (const token of previousOpportunity.Tokens) {
164
+ if (!newOpp.tokens.some(newToken => newToken.chainId === token.chainId && newToken.address === token.address)) {
165
+ toDisconnect.tokens.push({
166
+ chainId: token.chainId,
167
+ address: token.address,
168
+ });
169
+ }
170
+ }
171
+ }
150
172
  const data = {
151
173
  id: newOpp.id,
152
174
  action: newOpp.action ?? "HOLD",
@@ -172,11 +194,47 @@ export class OpportunityRepository {
172
194
  }),
173
195
  },
174
196
  };
197
+ const dataWithDisconnect = {
198
+ id: newOpp.id,
199
+ action: newOpp.action ?? "HOLD",
200
+ identifier: newOpp.identifier,
201
+ name: newOpp.name,
202
+ status: newOpp.status,
203
+ type: newOpp.type,
204
+ Chain: { connect: { id: newOpp.chainId } },
205
+ MainProtocol: !!newOpp.mainProtocol ? { connect: { id: newOpp.mainProtocol } } : undefined,
206
+ Protocols: {
207
+ connect: (newOpp.protocols ?? []).map((protocol) => {
208
+ return { id: protocol };
209
+ }),
210
+ disconnect: (toDisconnect.protocols ?? []).map((protocol) => {
211
+ return { id: protocol };
212
+ }),
213
+ },
214
+ Tokens: {
215
+ connect: newOpp.tokens.map((token) => {
216
+ return {
217
+ chainId_address: {
218
+ chainId: token.chainId,
219
+ address: token.address,
220
+ },
221
+ };
222
+ }),
223
+ disconnect: toDisconnect.tokens.map((token) => {
224
+ return {
225
+ chainId_address: {
226
+ chainId: token.chainId,
227
+ address: token.address,
228
+ },
229
+ };
230
+ }),
231
+ },
232
+ };
175
233
  if (upsert) {
176
234
  await apiDbClient.opportunity.upsert({
177
235
  where: { id: newOpp.id },
178
236
  create: data,
179
- update: data,
237
+ update: dataWithDisconnect,
180
238
  });
181
239
  }
182
240
  else {
@@ -49,7 +49,7 @@ export declare abstract class OpportunityService {
49
49
  } & {
50
50
  price?: number | null | undefined;
51
51
  })[][];
52
- mainProtocol: string | undefined;
52
+ mainProtocol: "splice" | "morpho" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "quick-swap" | "ramses" | "retro" | "stryke" | "sushiswap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "coumpound" | "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" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
53
53
  depositUrl: any;
54
54
  tags: string[];
55
55
  }>;
@@ -76,7 +76,7 @@ export declare abstract class OpportunityService {
76
76
  } & {
77
77
  price?: number | null | undefined;
78
78
  })[];
79
- mainProtocol: string | undefined;
79
+ mainProtocol: "splice" | "morpho" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "quick-swap" | "ramses" | "retro" | "stryke" | "sushiswap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "coumpound" | "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" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
80
80
  depositUrl: any;
81
81
  tags: string[];
82
82
  }>;
@@ -121,7 +121,7 @@ export declare abstract class OpportunityService {
121
121
  } & {
122
122
  price?: number | null | undefined;
123
123
  })[];
124
- mainProtocol: string | undefined;
124
+ mainProtocol: "splice" | "morpho" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "quick-swap" | "ramses" | "retro" | "stryke" | "sushiswap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "coumpound" | "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" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
125
125
  depositUrl: any;
126
126
  tags: string[];
127
127
  }>;
@@ -9,8 +9,8 @@ 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", "velodrome"];
13
- export type ProtocolId = (typeof protocolTypes)[number];
12
+ export declare const protocolIdList: readonly ["uniswap", "ambient", "arthswap", "base-swap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancake-swap", "quick-swap", "ramses", "retro", "stryke", "sushiswap", "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", "coumpound", "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", "angles", "enzyme", "toros", "vicuna", "bunni", "beratrax", "concrete", "cian", "pendle", "splice", "sturdy", "yei", "filament", "gammaswap", "maha", "tempest", "uranium", "hanji", "holdstation", "katana", "satlayer"];
13
+ export type ProtocolId = (typeof protocolIdList)[number];
14
14
  export declare const ProtocolResourceDto: import("@sinclair/typebox").TObject<{
15
15
  id: import("@sinclair/typebox").TString;
16
16
  name: import("@sinclair/typebox").TString;
@@ -52,4 +52,3 @@ export type GetProtocolsQueryModel = typeof GetProtocolsQueryDto.static;
52
52
  export type GetProtocolModel = typeof GetProtocolParamsDto.static;
53
53
  export type UpdateProtocolModel = typeof UpdateProtocolDto.static;
54
54
  export type CreateProtocolModel = typeof CreateProtocolDto.static;
55
- export {};
@@ -1,18 +1,18 @@
1
1
  import { t } from "elysia";
2
- const protocolTypes = [
3
- // ─── AMM ─────────────────────────────────────────────────────────────
2
+ export const protocolIdList = [
3
+ // ─── DEX ─────────────────────────────────────────────────────────────
4
4
  "uniswap",
5
5
  "ambient",
6
6
  "arthswap",
7
- "baseswap",
7
+ "base-swap",
8
8
  "camelot",
9
9
  "crust",
10
10
  "fenix",
11
11
  "horiza",
12
12
  "izumi",
13
13
  "kim",
14
- "pancakeswap",
15
- "quickswap",
14
+ "pancake-swap",
15
+ "quick-swap",
16
16
  "ramses",
17
17
  "retro",
18
18
  "stryke",
@@ -23,9 +23,9 @@ const protocolTypes = [
23
23
  "zero",
24
24
  "koi",
25
25
  "supswap",
26
- "zkswap",
26
+ "zk-swap",
27
27
  "thirdtrade",
28
- // ─── LP DEX ──────────────────────────────────────────────────────────
28
+ "swap-x",
29
29
  "velodrome",
30
30
  "aerodrome",
31
31
  "balancer",
@@ -43,9 +43,16 @@ const protocolTypes = [
43
43
  "zkSwapThreePool",
44
44
  "syncswap",
45
45
  "rfx",
46
- // ─── LP Lending ──────────────────────────────────────────────────────
46
+ "ra",
47
+ "maverick",
48
+ "trader-joe",
49
+ "velodrome",
50
+ "hanji",
51
+ // ─── Lending ──────────────────────────────────────────────────────
47
52
  "radiant",
48
53
  "aave",
54
+ "fraxlend",
55
+ "ironclad",
49
56
  "euler",
50
57
  "gearbox",
51
58
  "compound",
@@ -75,7 +82,40 @@ const protocolTypes = [
75
82
  "veda",
76
83
  "kyo",
77
84
  "sonex",
78
- "velodrome",
85
+ "lendle",
86
+ "tako-tako",
87
+ "equalizer",
88
+ "spectra",
89
+ "beraborrow",
90
+ "superlend",
91
+ "avalon",
92
+ // ─── Staking ──────────────────────────────────────────────────────
93
+ "angles",
94
+ // ─── Yield Aggregator ──────────────────────────────────────────────
95
+ "enzyme",
96
+ "toros",
97
+ "vicuna",
98
+ "bunni",
99
+ "beratrax",
100
+ "concrete",
101
+ "cian",
102
+ // ─── Fixed Yield ──────────────────────────────────────────────
103
+ "pendle",
104
+ "splice",
105
+ "sturdy",
106
+ "yei",
107
+ // ─── Option Trading ────────────────────────────────────────────────
108
+ "filament",
109
+ "gammaswap",
110
+ // ─── Synthetic Assets ────────────────────────────────────────────────
111
+ "maha",
112
+ "tempest",
113
+ "uranium",
114
+ "hanji",
115
+ // ─── Others ──────────────────────────────────────────────────────
116
+ "holdstation",
117
+ "katana",
118
+ "satlayer",
79
119
  ];
80
120
  // ─── DTOs ────────────────────────────────────────────────────────────────────
81
121
  export const ProtocolResourceDto = t.Object({
@@ -15,6 +15,18 @@ export class ProtocolRepository {
15
15
  });
16
16
  }
17
17
  static async changeId(oldId, newId) {
18
+ if (!(await ProtocolRepository.findMany({ id: newId }))[0]) {
19
+ await apiDbClient.protocol.create({
20
+ data: {
21
+ id: newId,
22
+ name: newId,
23
+ icon: "",
24
+ url: "",
25
+ description: "",
26
+ tags: [],
27
+ },
28
+ });
29
+ }
18
30
  await apiDbClient.opportunity.updateMany({
19
31
  where: {
20
32
  mainProtocolId: oldId,
@@ -5,6 +5,26 @@ import { ProtocolRepository } from "./protocol.repository";
5
5
  // ─── Protocols Services ──────────────────────────────────────────────────────
6
6
  export class ProtocolService {
7
7
  static async findMany(query) {
8
+ await ProtocolRepository.changeId("uniswap-v3", "uniswap");
9
+ await ProtocolRepository.changeId("uniswap-v3", "uniswap");
10
+ await ProtocolRepository.changeId("balancerpool", "balancer");
11
+ await ProtocolRepository.changeId("syncswap-v3", "syncswap");
12
+ await ProtocolRepository.changeId("akronv2", "akron");
13
+ await ProtocolRepository.changeId("aerodromev2", "aerodrome");
14
+ await ProtocolRepository.changeId("velodromev2", "velodrome");
15
+ await ProtocolRepository.changeId("fenixv2", "fenix");
16
+ await ProtocolRepository.changeId("supswap-v3", "supswap");
17
+ await ProtocolRepository.changeId("stryke-sushi", "stryke");
18
+ await ProtocolRepository.changeId("stryke-pcs", "stryke");
19
+ await ProtocolRepository.changeId("quickswap-algebra-v1_2", "quickswap");
20
+ await ProtocolRepository.changeId("quickswap-uni", "quickswap");
21
+ await ProtocolRepository.changeId("quickswap-algebra", "quickswap");
22
+ await ProtocolRepository.changeId("quickswap-2", "quickswap");
23
+ await ProtocolRepository.changeId("pancake-swap-v3", "pancakeswap");
24
+ await ProtocolRepository.changeId("baseswapv2", "base-swap");
25
+ await ProtocolRepository.changeId("baseswap", "base-swap");
26
+ await ProtocolRepository.changeId("sushi-swap-v3", "sushi-swap");
27
+ await ProtocolRepository.changeId("sushiswap", "sushi-swap");
8
28
  const protocols = await ProtocolRepository.findMany(query);
9
29
  const enrichedProtocols = protocols.map(({ MainOpportunities, ...protocol }) => ({
10
30
  ...protocol,
@@ -28,10 +48,6 @@ export class ProtocolService {
28
48
  return await ProtocolRepository.create(data);
29
49
  }
30
50
  static async update(id, data) {
31
- // let iconUri = data.icon;
32
- // if (data.iconFile) {
33
- // iconUri = await BucketService.upload("merkl-assets", `/protocols/${id}`, data.iconFile.stream(), true);
34
- // }
35
51
  return await ProtocolRepository.update(id, data);
36
52
  }
37
53
  static async changeLogoUrls() {
@@ -108,7 +108,7 @@ export declare const v4: Elysia<"/v4", false, {
108
108
  } & {
109
109
  price?: number | null | undefined;
110
110
  })[];
111
- mainProtocol: string | undefined;
111
+ mainProtocol: "splice" | "morpho" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "quick-swap" | "ramses" | "retro" | "stryke" | "sushiswap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "coumpound" | "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" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
112
112
  depositUrl: any;
113
113
  tags: string[];
114
114
  };
@@ -1173,7 +1173,7 @@ export declare const v4: Elysia<"/v4", false, {
1173
1173
  } & {
1174
1174
  price?: number | null | undefined;
1175
1175
  })[][];
1176
- mainProtocol: string | undefined;
1176
+ mainProtocol: "splice" | "morpho" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "quick-swap" | "ramses" | "retro" | "stryke" | "sushiswap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "coumpound" | "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" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
1177
1177
  depositUrl: any;
1178
1178
  tags: string[];
1179
1179
  };
@@ -2152,30 +2152,30 @@ export declare const v4: Elysia<"/v4", false, {
2152
2152
  body: {
2153
2153
  data: {
2154
2154
  properties: {
2155
- Symbol: {
2156
- rich_text: {
2157
- plain_text: string;
2158
- }[];
2159
- };
2160
- Icon: {
2155
+ "Icon (Required)": {
2161
2156
  files: {
2162
2157
  file: {
2163
2158
  url: string;
2164
2159
  };
2165
2160
  }[];
2166
2161
  };
2167
- Address: {
2162
+ "Address (in checksum format) (Required)": {
2168
2163
  rich_text: {
2169
2164
  plain_text: string;
2170
2165
  }[];
2171
2166
  };
2172
- "Chain ID": {
2167
+ "Chain ID (Required)": {
2173
2168
  number: number;
2174
2169
  };
2170
+ "Symbol (Optional)": {
2171
+ rich_text: {
2172
+ plain_text: string;
2173
+ }[];
2174
+ };
2175
2175
  Verified: {
2176
2176
  checkbox: boolean;
2177
2177
  };
2178
- "CoinGecko API ID": {
2178
+ "CoinGecko API ID (Recommended)": {
2179
2179
  rich_text: {
2180
2180
  plain_text: string;
2181
2181
  }[];
@@ -292,30 +292,30 @@ export declare const TokenController: Elysia<"/tokens", false, {
292
292
  body: {
293
293
  data: {
294
294
  properties: {
295
- Symbol: {
296
- rich_text: {
297
- plain_text: string;
298
- }[];
299
- };
300
- Icon: {
295
+ "Icon (Required)": {
301
296
  files: {
302
297
  file: {
303
298
  url: string;
304
299
  };
305
300
  }[];
306
301
  };
307
- Address: {
302
+ "Address (in checksum format) (Required)": {
308
303
  rich_text: {
309
304
  plain_text: string;
310
305
  }[];
311
306
  };
312
- "Chain ID": {
307
+ "Chain ID (Required)": {
313
308
  number: number;
314
309
  };
310
+ "Symbol (Optional)": {
311
+ rich_text: {
312
+ plain_text: string;
313
+ }[];
314
+ };
315
315
  Verified: {
316
316
  checkbox: boolean;
317
317
  };
318
- "CoinGecko API ID": {
318
+ "CoinGecko API ID (Recommended)": {
319
319
  rich_text: {
320
320
  plain_text: string;
321
321
  }[];
@@ -75,22 +75,22 @@ export declare const CreateTokenDto: import("@sinclair/typebox").TObject<{
75
75
  export declare const NotionWebhookDto: import("@sinclair/typebox").TObject<{
76
76
  data: import("@sinclair/typebox").TObject<{
77
77
  properties: import("@sinclair/typebox").TObject<{
78
- Icon: import("@sinclair/typebox").TObject<{
78
+ "Icon (Required)": import("@sinclair/typebox").TObject<{
79
79
  files: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
80
80
  file: import("@sinclair/typebox").TObject<{
81
81
  url: import("@sinclair/typebox").TString;
82
82
  }>;
83
83
  }>>;
84
84
  }>;
85
- Address: import("@sinclair/typebox").TObject<{
85
+ "Address (in checksum format) (Required)": import("@sinclair/typebox").TObject<{
86
86
  rich_text: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
87
87
  plain_text: import("@sinclair/typebox").TString;
88
88
  }>>;
89
89
  }>;
90
- "Chain ID": import("@sinclair/typebox").TObject<{
90
+ "Chain ID (Required)": import("@sinclair/typebox").TObject<{
91
91
  number: import("@sinclair/typebox").TNumber;
92
92
  }>;
93
- Symbol: import("@sinclair/typebox").TObject<{
93
+ "Symbol (Optional)": import("@sinclair/typebox").TObject<{
94
94
  rich_text: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
95
95
  plain_text: import("@sinclair/typebox").TString;
96
96
  }>>;
@@ -98,7 +98,7 @@ export declare const NotionWebhookDto: import("@sinclair/typebox").TObject<{
98
98
  Verified: import("@sinclair/typebox").TObject<{
99
99
  checkbox: import("@sinclair/typebox").TBoolean;
100
100
  }>;
101
- "CoinGecko API ID": import("@sinclair/typebox").TObject<{
101
+ "CoinGecko API ID (Recommended)": import("@sinclair/typebox").TObject<{
102
102
  rich_text: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
103
103
  plain_text: import("@sinclair/typebox").TString;
104
104
  }>>;
@@ -63,12 +63,14 @@ export const CreateTokenDto = t.Object({
63
63
  export const NotionWebhookDto = t.Object({
64
64
  data: t.Object({
65
65
  properties: t.Object({
66
- Icon: t.Object({ files: t.Array(t.Object({ file: t.Object({ url: t.String() }) })) }),
67
- Address: t.Object({ rich_text: t.Array(t.Object({ plain_text: t.String() })) }),
68
- "Chain ID": t.Object({ number: t.Numeric() }),
69
- Symbol: t.Object({ rich_text: t.Array(t.Object({ plain_text: t.String() })) }),
66
+ "Icon (Required)": t.Object({ files: t.Array(t.Object({ file: t.Object({ url: t.String() }) })) }),
67
+ "Address (in checksum format) (Required)": t.Object({
68
+ rich_text: t.Array(t.Object({ plain_text: t.String() })),
69
+ }),
70
+ "Chain ID (Required)": t.Object({ number: t.Numeric() }),
71
+ "Symbol (Optional)": t.Object({ rich_text: t.Array(t.Object({ plain_text: t.String() })) }),
70
72
  Verified: t.Object({ checkbox: t.Boolean() }),
71
- "CoinGecko API ID": t.Object({ rich_text: t.Array(t.Object({ plain_text: t.String() })) }),
73
+ "CoinGecko API ID (Recommended)": t.Object({ rich_text: t.Array(t.Object({ plain_text: t.String() })) }),
72
74
  }),
73
75
  }),
74
76
  }, { additionalProperties: true });
@@ -281,16 +281,16 @@ export class TokenService {
281
281
  const env = process.env.ENV === "prod" ? "production" : process.env.ENV;
282
282
  const bucket = new BucketService(`merkl-${env}-tokens`, `angle-${env}-1`);
283
283
  const properties = body.data.properties;
284
- const icon = properties.Icon.files?.[0]?.file.url;
284
+ const icon = properties["Icon (Required)"].files?.[0]?.file.url;
285
285
  const iconFile = await fetch(icon);
286
286
  const mimeType = iconFile.headers.get("content-type");
287
287
  const extension = mimeType.split("/")[1].split("+")[0];
288
- const address = throwOnInvalidRequiredAddress(properties.Address.rich_text[0].plain_text);
289
- const chainId = properties["Chain ID"].number;
288
+ const address = throwOnInvalidRequiredAddress(properties["Address (in checksum format) (Required)"].rich_text[0].plain_text);
289
+ const chainId = properties["Chain ID (Required)"].number;
290
290
  throwOnUnsupportedChainId(chainId);
291
- const displaySymbol = properties.Symbol.rich_text[0]?.plain_text;
291
+ const displaySymbol = properties["Symbol (Optional)"].rich_text[0]?.plain_text;
292
292
  const isVerified = properties.Verified.checkbox;
293
- const coingeckoApiId = properties["CoinGecko API ID"].rich_text[0]?.plain_text;
293
+ const coingeckoApiId = properties["CoinGecko API ID (Recommended)"].rich_text[0]?.plain_text;
294
294
  const byteArray = await iconFile.bytes(); // Unknown type error here probably due to bun/types
295
295
  const [token] = await TokenService.findManyOrCreate([
296
296
  {
@@ -1,3 +1,4 @@
1
1
  export declare function camelToKebabCase(str: string): string;
2
2
  export declare function kebabToCamelCase(str: string): string;
3
3
  export declare function kebabToPascalCase(str: string): string;
4
+ export declare function capitalize(str: string): string;
@@ -10,3 +10,6 @@ export function kebabToPascalCase(str) {
10
10
  .map(word => word.charAt(0).toUpperCase() + word.slice(1))
11
11
  .join("");
12
12
  }
13
+ export function capitalize(str) {
14
+ return str.charAt(0).toUpperCase() + str.slice(1);
15
+ }