@merkl/api 0.18.13 → 0.18.14

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.
@@ -20,8 +20,17 @@ export declare class Cache {
20
20
  private setRaw;
21
21
  /** @notice Set value for a given key for both local and raw cache */
22
22
  private set;
23
+ /**
24
+ * @deprecated Local cache is not used anymore
25
+ */
23
26
  private isLocallyCached;
27
+ /**
28
+ * @deprecated Local cache is not used anymore
29
+ */
24
30
  private setLocally;
31
+ /**
32
+ * @deprecated Local cache is not used anymore
33
+ */
25
34
  private getLocally;
26
35
  /**
27
36
  * @returns the uncompressed (if enabled), parsed and typed data from the cache
@@ -63,16 +63,25 @@ export class Cache {
63
63
  /*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
64
64
  LOCAL CACHE
65
65
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
66
- isLocallyCached(key) {
66
+ /**
67
+ * @deprecated Local cache is not used anymore
68
+ */
69
+ isLocallyCached(_key) {
67
70
  return false;
68
71
  // return this.localCache.has(key);
69
72
  }
70
- setLocally(key, value) {
73
+ /**
74
+ * @deprecated Local cache is not used anymore
75
+ */
76
+ setLocally(_key, _value) {
71
77
  return true;
72
78
  // const { localCacheTtl } = CacheDeclaration[Cache.baseKey<T, Key>(key)] as { localCacheTtl?: number };
73
79
  // return this.localCache.set(key, value, localCacheTtl ?? DEFAULT_LOCAL_TTL);
74
80
  }
75
- getLocally(key) {
81
+ /**
82
+ * @deprecated Local cache is not used anymore
83
+ */
84
+ getLocally(_key) {
76
85
  return undefined;
77
86
  // return this.localCache.get(key);
78
87
  }
@@ -475,6 +475,7 @@ declare const eden: {
475
475
  chainId?: string | undefined;
476
476
  mainProtocolId?: string | undefined;
477
477
  campaigns?: boolean | undefined;
478
+ rewardTokenSymbol?: string | undefined;
478
479
  order?: string | undefined;
479
480
  test?: boolean | undefined;
480
481
  minimumTvl?: number | undefined;
@@ -662,6 +663,7 @@ declare const eden: {
662
663
  chainId?: string | undefined;
663
664
  mainProtocolId?: string | undefined;
664
665
  campaigns?: boolean | undefined;
666
+ rewardTokenSymbol?: string | undefined;
665
667
  order?: string | undefined;
666
668
  test?: boolean | undefined;
667
669
  minimumTvl?: number | undefined;
@@ -864,6 +866,7 @@ declare const eden: {
864
866
  chainId?: string | undefined;
865
867
  mainProtocolId?: string | undefined;
866
868
  campaigns?: boolean | undefined;
869
+ rewardTokenSymbol?: string | undefined;
867
870
  order?: string | undefined;
868
871
  test?: boolean | undefined;
869
872
  minimumTvl?: number | undefined;
@@ -895,6 +898,7 @@ declare const eden: {
895
898
  chainId?: string | undefined;
896
899
  mainProtocolId?: string | undefined;
897
900
  campaigns?: boolean | undefined;
901
+ rewardTokenSymbol?: string | undefined;
898
902
  order?: string | undefined;
899
903
  test?: boolean | undefined;
900
904
  minimumTvl?: number | undefined;
@@ -926,6 +930,7 @@ declare const eden: {
926
930
  chainId?: string | undefined;
927
931
  mainProtocolId?: string | undefined;
928
932
  campaigns?: boolean | undefined;
933
+ rewardTokenSymbol?: string | undefined;
929
934
  order?: string | undefined;
930
935
  test?: boolean | undefined;
931
936
  minimumTvl?: number | undefined;
@@ -3945,6 +3950,7 @@ declare const eden: {
3945
3950
  chainId?: string | undefined;
3946
3951
  mainProtocolId?: string | undefined;
3947
3952
  campaigns?: boolean | undefined;
3953
+ rewardTokenSymbol?: string | undefined;
3948
3954
  order?: string | undefined;
3949
3955
  test?: boolean | undefined;
3950
3956
  minimumTvl?: number | undefined;
@@ -4132,6 +4138,7 @@ declare const eden: {
4132
4138
  chainId?: string | undefined;
4133
4139
  mainProtocolId?: string | undefined;
4134
4140
  campaigns?: boolean | undefined;
4141
+ rewardTokenSymbol?: string | undefined;
4135
4142
  order?: string | undefined;
4136
4143
  test?: boolean | undefined;
4137
4144
  minimumTvl?: number | undefined;
@@ -4334,6 +4341,7 @@ declare const eden: {
4334
4341
  chainId?: string | undefined;
4335
4342
  mainProtocolId?: string | undefined;
4336
4343
  campaigns?: boolean | undefined;
4344
+ rewardTokenSymbol?: string | undefined;
4337
4345
  order?: string | undefined;
4338
4346
  test?: boolean | undefined;
4339
4347
  minimumTvl?: number | undefined;
@@ -4365,6 +4373,7 @@ declare const eden: {
4365
4373
  chainId?: string | undefined;
4366
4374
  mainProtocolId?: string | undefined;
4367
4375
  campaigns?: boolean | undefined;
4376
+ rewardTokenSymbol?: string | undefined;
4368
4377
  order?: string | undefined;
4369
4378
  test?: boolean | undefined;
4370
4379
  minimumTvl?: number | undefined;
@@ -4396,6 +4405,7 @@ declare const eden: {
4396
4405
  chainId?: string | undefined;
4397
4406
  mainProtocolId?: string | undefined;
4398
4407
  campaigns?: boolean | undefined;
4408
+ rewardTokenSymbol?: string | undefined;
4399
4409
  order?: string | undefined;
4400
4410
  test?: boolean | undefined;
4401
4411
  minimumTvl?: number | undefined;
@@ -7881,6 +7891,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
7881
7891
  chainId?: string | undefined;
7882
7892
  mainProtocolId?: string | undefined;
7883
7893
  campaigns?: boolean | undefined;
7894
+ rewardTokenSymbol?: string | undefined;
7884
7895
  order?: string | undefined;
7885
7896
  test?: boolean | undefined;
7886
7897
  minimumTvl?: number | undefined;
@@ -8073,6 +8084,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8073
8084
  chainId?: string | undefined;
8074
8085
  mainProtocolId?: string | undefined;
8075
8086
  campaigns?: boolean | undefined;
8087
+ rewardTokenSymbol?: string | undefined;
8076
8088
  order?: string | undefined;
8077
8089
  test?: boolean | undefined;
8078
8090
  minimumTvl?: number | undefined;
@@ -8560,6 +8572,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8560
8572
  chainId?: string | undefined;
8561
8573
  mainProtocolId?: string | undefined;
8562
8574
  campaigns?: boolean | undefined;
8575
+ rewardTokenSymbol?: string | undefined;
8563
8576
  order?: string | undefined;
8564
8577
  test?: boolean | undefined;
8565
8578
  minimumTvl?: number | undefined;
@@ -8599,6 +8612,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8599
8612
  chainId?: string | undefined;
8600
8613
  mainProtocolId?: string | undefined;
8601
8614
  campaigns?: boolean | undefined;
8615
+ rewardTokenSymbol?: string | undefined;
8602
8616
  order?: string | undefined;
8603
8617
  test?: boolean | undefined;
8604
8618
  minimumTvl?: number | undefined;
@@ -8639,6 +8653,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8639
8653
  chainId?: string | undefined;
8640
8654
  mainProtocolId?: string | undefined;
8641
8655
  campaigns?: boolean | undefined;
8656
+ rewardTokenSymbol?: string | undefined;
8642
8657
  order?: string | undefined;
8643
8658
  test?: boolean | undefined;
8644
8659
  minimumTvl?: number | undefined;
@@ -13183,6 +13198,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13183
13198
  chainId?: string | undefined;
13184
13199
  mainProtocolId?: string | undefined;
13185
13200
  campaigns?: boolean | undefined;
13201
+ rewardTokenSymbol?: string | undefined;
13186
13202
  order?: string | undefined;
13187
13203
  test?: boolean | undefined;
13188
13204
  minimumTvl?: number | undefined;
@@ -13370,6 +13386,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13370
13386
  chainId?: string | undefined;
13371
13387
  mainProtocolId?: string | undefined;
13372
13388
  campaigns?: boolean | undefined;
13389
+ rewardTokenSymbol?: string | undefined;
13373
13390
  order?: string | undefined;
13374
13391
  test?: boolean | undefined;
13375
13392
  minimumTvl?: number | undefined;
@@ -13572,6 +13589,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13572
13589
  chainId?: string | undefined;
13573
13590
  mainProtocolId?: string | undefined;
13574
13591
  campaigns?: boolean | undefined;
13592
+ rewardTokenSymbol?: string | undefined;
13575
13593
  order?: string | undefined;
13576
13594
  test?: boolean | undefined;
13577
13595
  minimumTvl?: number | undefined;
@@ -13603,6 +13621,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13603
13621
  chainId?: string | undefined;
13604
13622
  mainProtocolId?: string | undefined;
13605
13623
  campaigns?: boolean | undefined;
13624
+ rewardTokenSymbol?: string | undefined;
13606
13625
  order?: string | undefined;
13607
13626
  test?: boolean | undefined;
13608
13627
  minimumTvl?: number | undefined;
@@ -13634,6 +13653,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13634
13653
  chainId?: string | undefined;
13635
13654
  mainProtocolId?: string | undefined;
13636
13655
  campaigns?: boolean | undefined;
13656
+ rewardTokenSymbol?: string | undefined;
13637
13657
  order?: string | undefined;
13638
13658
  test?: boolean | undefined;
13639
13659
  minimumTvl?: number | undefined;
@@ -16653,6 +16673,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
16653
16673
  chainId?: string | undefined;
16654
16674
  mainProtocolId?: string | undefined;
16655
16675
  campaigns?: boolean | undefined;
16676
+ rewardTokenSymbol?: string | undefined;
16656
16677
  order?: string | undefined;
16657
16678
  test?: boolean | undefined;
16658
16679
  minimumTvl?: number | undefined;
@@ -16840,6 +16861,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
16840
16861
  chainId?: string | undefined;
16841
16862
  mainProtocolId?: string | undefined;
16842
16863
  campaigns?: boolean | undefined;
16864
+ rewardTokenSymbol?: string | undefined;
16843
16865
  order?: string | undefined;
16844
16866
  test?: boolean | undefined;
16845
16867
  minimumTvl?: number | undefined;
@@ -17042,6 +17064,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
17042
17064
  chainId?: string | undefined;
17043
17065
  mainProtocolId?: string | undefined;
17044
17066
  campaigns?: boolean | undefined;
17067
+ rewardTokenSymbol?: string | undefined;
17045
17068
  order?: string | undefined;
17046
17069
  test?: boolean | undefined;
17047
17070
  minimumTvl?: number | undefined;
@@ -17073,6 +17096,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
17073
17096
  chainId?: string | undefined;
17074
17097
  mainProtocolId?: string | undefined;
17075
17098
  campaigns?: boolean | undefined;
17099
+ rewardTokenSymbol?: string | undefined;
17076
17100
  order?: string | undefined;
17077
17101
  test?: boolean | undefined;
17078
17102
  minimumTvl?: number | undefined;
@@ -17104,6 +17128,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
17104
17128
  chainId?: string | undefined;
17105
17129
  mainProtocolId?: string | undefined;
17106
17130
  campaigns?: boolean | undefined;
17131
+ rewardTokenSymbol?: string | undefined;
17107
17132
  order?: string | undefined;
17108
17133
  test?: boolean | undefined;
17109
17134
  minimumTvl?: number | undefined;
@@ -267,6 +267,7 @@ declare const app: Elysia<"", false, {
267
267
  chainId?: string | undefined;
268
268
  mainProtocolId?: string | undefined;
269
269
  campaigns?: boolean | undefined;
270
+ rewardTokenSymbol?: string | undefined;
270
271
  order?: string | undefined;
271
272
  test?: boolean | undefined;
272
273
  minimumTvl?: number | undefined;
@@ -459,6 +460,7 @@ declare const app: Elysia<"", false, {
459
460
  chainId?: string | undefined;
460
461
  mainProtocolId?: string | undefined;
461
462
  campaigns?: boolean | undefined;
463
+ rewardTokenSymbol?: string | undefined;
462
464
  order?: string | undefined;
463
465
  test?: boolean | undefined;
464
466
  minimumTvl?: number | undefined;
@@ -946,6 +948,7 @@ declare const app: Elysia<"", false, {
946
948
  chainId?: string | undefined;
947
949
  mainProtocolId?: string | undefined;
948
950
  campaigns?: boolean | undefined;
951
+ rewardTokenSymbol?: string | undefined;
949
952
  order?: string | undefined;
950
953
  test?: boolean | undefined;
951
954
  minimumTvl?: number | undefined;
@@ -985,6 +988,7 @@ declare const app: Elysia<"", false, {
985
988
  chainId?: string | undefined;
986
989
  mainProtocolId?: string | undefined;
987
990
  campaigns?: boolean | undefined;
991
+ rewardTokenSymbol?: string | undefined;
988
992
  order?: string | undefined;
989
993
  test?: boolean | undefined;
990
994
  minimumTvl?: number | undefined;
@@ -1025,6 +1029,7 @@ declare const app: Elysia<"", false, {
1025
1029
  chainId?: string | undefined;
1026
1030
  mainProtocolId?: string | undefined;
1027
1031
  campaigns?: boolean | undefined;
1032
+ rewardTokenSymbol?: string | undefined;
1028
1033
  order?: string | undefined;
1029
1034
  test?: boolean | undefined;
1030
1035
  minimumTvl?: number | undefined;
@@ -10,8 +10,8 @@ type callType = {
10
10
  };
11
11
  type callKeysxU308 = mandatoryCallKeys & {
12
12
  pool: string;
13
- token0: string;
14
- token1: string;
13
+ _token0: string;
14
+ _token1: string;
15
15
  symbolToken0: string;
16
16
  symbolToken1: string;
17
17
  decimalsToken0: string;
@@ -5,16 +5,16 @@ export class xU308Processor extends GenericProcessor {
5
5
  rounds = {
6
6
  round1: [],
7
7
  round2: [
8
- { key: "token0", call: "token0", target: "pool" },
9
- { key: "token1", call: "token1", target: "pool" },
8
+ { key: "_token0", call: "token0", target: "pool" },
9
+ { key: "_token1", call: "token1", target: "pool" },
10
10
  ],
11
11
  round3: [
12
- { key: "symbolToken0", call: "symbol", target: "token0" },
13
- { key: "symbolToken1", call: "symbol", target: "token1" },
14
- { key: "decimalsToken0", call: "decimals", target: "token0" },
15
- { key: "decimalsToken1", call: "decimals", target: "token1" },
16
- { key: "balanceToken0", call: "balanceOf", target: "token0", metaData: "pool" },
17
- { key: "balanceToken1", call: "balanceOf", target: "token1", metaData: "pool" },
12
+ { key: "symbolToken0", call: "symbol", target: "_token0" },
13
+ { key: "symbolToken1", call: "symbol", target: "_token1" },
14
+ { key: "decimalsToken0", call: "decimals", target: "_token0" },
15
+ { key: "decimalsToken1", call: "decimals", target: "_token1" },
16
+ { key: "balanceToken0", call: "balanceOf", target: "_token0", metaData: "pool" },
17
+ { key: "balanceToken1", call: "balanceOf", target: "_token1", metaData: "pool" },
18
18
  ],
19
19
  round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
20
20
  };
@@ -25,7 +25,7 @@ export class xU308Processor extends GenericProcessor {
25
25
  async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
26
26
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
27
27
  let priceTargetToken = 0;
28
- if (typeInfo.token0 !== typeInfo.tokenAddress) {
28
+ if (typeInfo._token0 !== typeInfo.tokenAddress) {
29
29
  const priceToken0 = (await pricer.get({ symbol: typeInfo.symbolToken0 })) ?? 0;
30
30
  priceTargetToken =
31
31
  (priceToken0 * BN2Number(typeInfo.balanceToken0, Number(typeInfo.decimalsToken0))) /
@@ -1,2 +1,7 @@
1
1
  import type { MerklChainId } from "@sdk";
2
+ /**
3
+ * @deprecated - to remove once:
4
+ * - old update page is deprecated
5
+ * - v3 campaigns route is removed
6
+ */
2
7
  export declare const staticCampaignWithCache: (chainId: MerklChainId) => Promise<any>;
@@ -7,4 +7,9 @@ async function staticCampaigns(chainId) {
7
7
  },
8
8
  });
9
9
  }
10
+ /**
11
+ * @deprecated - to remove once:
12
+ * - old update page is deprecated
13
+ * - v3 campaigns route is removed
14
+ */
10
15
  export const staticCampaignWithCache = async (chainId) => await Redis.getOrSet(`StaticCampaigns_${chainId}`, staticCampaigns, chainId);
@@ -20,8 +20,7 @@ export class ClaimService {
20
20
  return acc;
21
21
  }, {});
22
22
  const promises = await Promise.allSettled(chainIds.map(chainId => ClaimRepository.fetch(chainId, params.address)));
23
- const claims = promises
24
- .filter(p => p.status === "fulfilled")
23
+ const claims = promises.filter(p => p.status === "fulfilled")
25
24
  .flatMap(p => p.value ?? []) // null/undefined claim arrays
26
25
  .filter(claim => {
27
26
  // Ensure the claim's token exists and matches the chainFilter
@@ -51,11 +51,11 @@ export class EnsoService {
51
51
  return await Promise.all(route.map(async (r) => {
52
52
  switch (r.action) {
53
53
  case "deposit": {
54
- const tokensIn = await TokenService.findManyOrCreate(r.tokenIn.map(t => ({ address: t, chainId })));
54
+ const tokensIn = (await TokenService.findManyOrCreate(r.tokenIn.map(t => ({ address: t, chainId })))).filter(a => !!a);
55
55
  const [tokenOut] = await TokenService.findManyOrCreate(r.tokenOut.map(t => ({ address: t, chainId })));
56
56
  return {
57
57
  action: "deposit",
58
- tokens: tokensIn.filter(a => !!a),
58
+ tokens: tokensIn,
59
59
  tokensOut: [{ ...tokenOut, amount: amountOut }],
60
60
  };
61
61
  }
@@ -122,6 +122,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
122
122
  chainId?: string | undefined;
123
123
  mainProtocolId?: string | undefined;
124
124
  campaigns?: boolean | undefined;
125
+ rewardTokenSymbol?: string | undefined;
125
126
  order?: string | undefined;
126
127
  test?: boolean | undefined;
127
128
  minimumTvl?: number | undefined;
@@ -314,6 +315,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
314
315
  chainId?: string | undefined;
315
316
  mainProtocolId?: string | undefined;
316
317
  campaigns?: boolean | undefined;
318
+ rewardTokenSymbol?: string | undefined;
317
319
  order?: string | undefined;
318
320
  test?: boolean | undefined;
319
321
  minimumTvl?: number | undefined;
@@ -801,6 +803,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
801
803
  chainId?: string | undefined;
802
804
  mainProtocolId?: string | undefined;
803
805
  campaigns?: boolean | undefined;
806
+ rewardTokenSymbol?: string | undefined;
804
807
  order?: string | undefined;
805
808
  test?: boolean | undefined;
806
809
  minimumTvl?: number | undefined;
@@ -840,6 +843,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
840
843
  chainId?: string | undefined;
841
844
  mainProtocolId?: string | undefined;
842
845
  campaigns?: boolean | undefined;
846
+ rewardTokenSymbol?: string | undefined;
843
847
  order?: string | undefined;
844
848
  test?: boolean | undefined;
845
849
  minimumTvl?: number | undefined;
@@ -880,6 +884,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
880
884
  chainId?: string | undefined;
881
885
  mainProtocolId?: string | undefined;
882
886
  campaigns?: boolean | undefined;
887
+ rewardTokenSymbol?: string | undefined;
883
888
  order?: string | undefined;
884
889
  test?: boolean | undefined;
885
890
  minimumTvl?: number | undefined;
@@ -286,6 +286,7 @@ export declare const GetOpportunitiesQueryDto: import("@sinclair/typebox").TObje
286
286
  identifier: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
287
287
  campaigns: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
288
288
  tokens: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
289
+ rewardTokenSymbol: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
289
290
  sort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRegExp>;
290
291
  order: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRegExp>;
291
292
  mainProtocolId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -69,6 +69,9 @@ export const GetOpportunitiesQueryDto = t.Object({
69
69
  identifier: t.Optional(t.String({ description: "Filter by identifier (mainParameter)." })),
70
70
  campaigns: t.Optional(t.Boolean({ description: "Include campaign data. Will slow down the request. Default: false" })),
71
71
  tokens: t.Optional(t.String({ description: "A comma separated list of token symbol. Use to filter by token" })),
72
+ rewardTokenSymbol: t.Optional(t.String({
73
+ description: "Filter by opportunity that have at least 1 campaigns where the reward token has this symbol",
74
+ })),
72
75
  sort: t.Optional(t.RegExp(/(apr|tvl|rewards)/, { description: "Sort by `apr`, `tvl` or `rewards`" })),
73
76
  order: t.Optional(t.RegExp(/desc|asc/, {
74
77
  description: "`asc` to sort in ascending order or `desc` to sort in descending order.",
@@ -13,6 +13,7 @@ export class OpportunityRepository {
13
13
  const actions = query.action?.split(",");
14
14
  const status = query.status?.split(",");
15
15
  const tokens = query.tokens?.split(",");
16
+ const rewardTokenSymbol = query.rewardTokenSymbol;
16
17
  const types = query.type?.split(",");
17
18
  const protocols = query.mainProtocolId?.split(",");
18
19
  const identifiers = query.identifier?.split(",");
@@ -36,11 +37,16 @@ export class OpportunityRepository {
36
37
  status: !status ? undefined : { in: status },
37
38
  mainProtocolId: !protocols ? undefined : { in: protocols, mode: "insensitive" },
38
39
  identifier: !identifier ? undefined : { in: identifiers, mode: "insensitive" },
39
- Campaigns: test || !creatorAddress
40
+ Campaigns: test && !creatorAddress && !rewardTokenSymbol
40
41
  ? undefined
41
42
  : {
42
43
  some: {
43
- RewardToken: !test ? { isTest: false } : undefined,
44
+ RewardToken: test && !rewardTokenSymbol
45
+ ? undefined
46
+ : {
47
+ isTest: !test ? false : undefined,
48
+ symbol: rewardTokenSymbol ? { equals: rewardTokenSymbol, mode: "insensitive" } : undefined,
49
+ },
44
50
  creatorAddress: creatorAddress ? creatorAddress : undefined,
45
51
  },
46
52
  },
@@ -619,9 +619,7 @@ const EtherlinkInterfaceCampaigns = {
619
619
  campaignType: Campaign.EVENT_BASED,
620
620
  contract: "0xd0bc067cf877f7b76ceb331891331d9e6acda1a7",
621
621
  eventID: id("OrderPlaced(address,uint64,bool,uint128,uint72,uint128,uint128,uint128,uint128,uint128,bool,bool)"),
622
- topicToData: [
623
- { topicIndex: 1, decodeKeyTopic: "address", dataIndex: 1, multiplier: (3n * 10n ** (7n + 12n)).toString() },
624
- ],
622
+ topicToData: [{ topicIndex: 1, decodeKeyTopic: "address", dataIndex: 7, multiplier: (10n ** 12n).toString() }],
625
623
  computeScoreParameters: {
626
624
  computeMethod: ComputeScoreMethod.cappedScorePercentageHistorical,
627
625
  computeSettings: {
@@ -661,9 +659,7 @@ const EtherlinkInterfaceCampaigns = {
661
659
  campaignType: Campaign.EVENT_BASED,
662
660
  contract: "0x65ea4dd7f789c71c0f57ed84b3bdc3062898d3cb",
663
661
  eventID: id("OrderPlaced(address,uint64,bool,uint128,uint72,uint128,uint128,uint128,uint128,uint128,bool,bool)"),
664
- topicToData: [
665
- { topicIndex: 1, decodeKeyTopic: "address", dataIndex: 1, multiplier: (3n * 10n ** (7n + 12n)).toString() },
666
- ],
662
+ topicToData: [{ topicIndex: 1, decodeKeyTopic: "address", dataIndex: 7, multiplier: (10n ** 12n).toString() }],
667
663
  computeScoreParameters: {
668
664
  computeMethod: ComputeScoreMethod.cappedScorePercentageHistorical,
669
665
  computeSettings: {
@@ -703,9 +699,7 @@ const EtherlinkInterfaceCampaigns = {
703
699
  campaignType: Campaign.EVENT_BASED,
704
700
  contract: "0xbb6b01d94e3f6ebae8647cb56d544f57928ab758",
705
701
  eventID: id("OrderPlaced(address,uint64,bool,uint128,uint72,uint128,uint128,uint128,uint128,uint128,bool,bool)"),
706
- topicToData: [
707
- { topicIndex: 1, decodeKeyTopic: "address", dataIndex: 1, multiplier: (3n * 10n ** (7n + 12n)).toString() },
708
- ],
702
+ topicToData: [{ topicIndex: 1, decodeKeyTopic: "address", dataIndex: 7, multiplier: (10n ** 12n).toString() }],
709
703
  computeScoreParameters: {
710
704
  computeMethod: ComputeScoreMethod.cappedScorePercentageHistorical,
711
705
  computeSettings: {
@@ -137,6 +137,7 @@ export declare const v4: Elysia<"/v4", false, {
137
137
  chainId?: string | undefined;
138
138
  mainProtocolId?: string | undefined;
139
139
  campaigns?: boolean | undefined;
140
+ rewardTokenSymbol?: string | undefined;
140
141
  order?: string | undefined;
141
142
  test?: boolean | undefined;
142
143
  minimumTvl?: number | undefined;
@@ -329,6 +330,7 @@ export declare const v4: Elysia<"/v4", false, {
329
330
  chainId?: string | undefined;
330
331
  mainProtocolId?: string | undefined;
331
332
  campaigns?: boolean | undefined;
333
+ rewardTokenSymbol?: string | undefined;
332
334
  order?: string | undefined;
333
335
  test?: boolean | undefined;
334
336
  minimumTvl?: number | undefined;
@@ -816,6 +818,7 @@ export declare const v4: Elysia<"/v4", false, {
816
818
  chainId?: string | undefined;
817
819
  mainProtocolId?: string | undefined;
818
820
  campaigns?: boolean | undefined;
821
+ rewardTokenSymbol?: string | undefined;
819
822
  order?: string | undefined;
820
823
  test?: boolean | undefined;
821
824
  minimumTvl?: number | undefined;
@@ -855,6 +858,7 @@ export declare const v4: Elysia<"/v4", false, {
855
858
  chainId?: string | undefined;
856
859
  mainProtocolId?: string | undefined;
857
860
  campaigns?: boolean | undefined;
861
+ rewardTokenSymbol?: string | undefined;
858
862
  order?: string | undefined;
859
863
  test?: boolean | undefined;
860
864
  minimumTvl?: number | undefined;
@@ -895,6 +899,7 @@ export declare const v4: Elysia<"/v4", false, {
895
899
  chainId?: string | undefined;
896
900
  mainProtocolId?: string | undefined;
897
901
  campaigns?: boolean | undefined;
902
+ rewardTokenSymbol?: string | undefined;
898
903
  order?: string | undefined;
899
904
  test?: boolean | undefined;
900
905
  minimumTvl?: number | undefined;
@@ -98,8 +98,10 @@ export class StatusService {
98
98
  const res = {};
99
99
  for (const [index, chainIdString] of Object.keys(merklRoots).entries()) {
100
100
  const chainId = Number.parseInt(chainIdString);
101
- const delayedCampaigns = delayedCampaignArray[index].status === "rejected" ? [] : delayedCampaignArray[index].value;
102
- const liveCampaigns = liveCampaignArray[index].status === "rejected" ? 0 : liveCampaignArray[index].value;
101
+ const delayedCampaignResult = delayedCampaignArray[index];
102
+ const liveCampaignResult = liveCampaignArray[index];
103
+ const delayedCampaigns = delayedCampaignResult.status === "rejected" ? [] : delayedCampaignResult.value;
104
+ const liveCampaigns = liveCampaignResult.status === "rejected" ? 0 : liveCampaignResult.value;
103
105
  if (!registry(chainId)?.Merkl?.DistributionCreator || !registry(chainId)?.Merkl?.Distributor) {
104
106
  log.warn(`Missing registry for ${NETWORK_LABELS[chainId]}`);
105
107
  continue;
@@ -76,7 +76,15 @@ export class TokenService {
76
76
  chainId: token.chainId,
77
77
  address: token.address,
78
78
  icon: "",
79
- ...Object.assign({ name: "unknown", decimals: 18, symbol: "UNKNOWN", verified: false, isTest: false, isNative: false }, onchainData),
79
+ ...Object.assign({
80
+ name: "unknown",
81
+ decimals: 18,
82
+ symbol: "UNKNOWN",
83
+ verified: false,
84
+ isTest: false,
85
+ isPoint: false,
86
+ isNative: false,
87
+ }, onchainData),
80
88
  };
81
89
  }
82
90
  static async tryToFillWithCoingeckoIcons() {
@@ -344,6 +352,7 @@ export class TokenService {
344
352
  decimals: token.decimals,
345
353
  icon: token.logoURI,
346
354
  isTest: false,
355
+ isPoint: false,
347
356
  isNative: false,
348
357
  });
349
358
  log.local(`Token created: ${res?.symbol} on ${NETWORK_LABELS[Number.parseInt(chain)]}`);
@@ -26,7 +26,7 @@ export default class PriceService {
26
26
  });
27
27
  };
28
28
  async fetchPrices() {
29
- const tokenPriceSources = await PriceSourceService.findManyPriceSources();
29
+ const tokenPriceSources = await PriceSourceService.findManyPriceSources({});
30
30
  /**
31
31
  * @description Factory pricer's call to get prices from different sources
32
32
  */
@@ -22,7 +22,7 @@ export default class ERC4626Service {
22
22
  return res;
23
23
  });
24
24
  const resolvedPrices = await Promise.all(pricePromises);
25
- return resolvedPrices.flat().filter(price => price !== undefined);
25
+ return resolvedPrices.flat().filter(price => price !== undefined && price !== null);
26
26
  }
27
27
  async priceCalculation(rate, vaultToken) {
28
28
  try {
@@ -1,4 +1,21 @@
1
1
  import { type ChainId } from "@sdk";
2
+ /**
3
+ * Use this function to throw an error if the address is invalid
4
+ * and normalize the address to its checksum version
5
+ *
6
+ * @dev Usage: params.address = throwOnInvalidAddress(params.address);
7
+ */
2
8
  export declare const throwOnInvalidRequiredAddress: (address: string) => string;
3
- export declare const throwOnInvalidAddress: (address: string) => string | undefined;
9
+ /**
10
+ * Use this function to throw an error if the address is invalid
11
+ * and normalize the address to its checksum version
12
+ *
13
+ * Address can be null or undefined
14
+ *
15
+ * @dev Usage: params.address = throwOnInvalidAddress(params.address);
16
+ */
17
+ export declare const throwOnInvalidAddress: (address: string | undefined) => string | undefined;
18
+ /**
19
+ * Use this function to throw an error if the chainId is not supported by Merkl
20
+ */
4
21
  export declare const throwOnUnsupportedChainId: (chainId: ChainId) => void;