@merkl/api 0.18.12 → 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.
- package/dist/src/cache/index.d.ts +9 -0
- package/dist/src/cache/index.js +12 -3
- package/dist/src/eden/index.d.ts +31 -9
- package/dist/src/index.d.ts +7 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/xU308Processor.d.ts +2 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/xU308Processor.js +9 -9
- package/dist/src/libs/staticCampaigns.d.ts +5 -0
- package/dist/src/libs/staticCampaigns.js +5 -0
- package/dist/src/modules/v4/claims/claims.service.js +1 -2
- package/dist/src/modules/v4/enso/enso.service.js +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +5 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.js +3 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +8 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +3 -9
- package/dist/src/modules/v4/router.d.ts +5 -0
- package/dist/src/modules/v4/status/status.service.js +4 -2
- package/dist/src/modules/v4/token/token.service.js +10 -1
- package/dist/src/routes/v3/campaigns.d.ts +2 -3
- package/dist/src/routes/v3/campaigns.js +59 -21
- package/dist/src/routes/v3/router.d.ts +2 -3
- package/dist/src/utils/prices/priceService.js +1 -1
- package/dist/src/utils/prices/services/erc4626Service.js +1 -1
- package/dist/src/utils/throw.d.ts +18 -1
- package/dist/src/utils/throw.js +17 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -5
@@ -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
|
package/dist/src/cache/index.js
CHANGED
@@ -63,16 +63,25 @@ export class Cache {
|
|
63
63
|
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
64
64
|
LOCAL CACHE
|
65
65
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
|
66
|
-
|
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
|
-
|
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
|
-
|
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
|
}
|
package/dist/src/eden/index.d.ts
CHANGED
@@ -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;
|
@@ -7088,9 +7098,8 @@ declare const eden: {
|
|
7088
7098
|
};
|
7089
7099
|
fetch?: RequestInit | undefined;
|
7090
7100
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
7091
|
-
|
7092
|
-
|
7093
|
-
};
|
7101
|
+
[x: string]: any;
|
7102
|
+
200: any;
|
7094
7103
|
}>>;
|
7095
7104
|
};
|
7096
7105
|
campaignsForMainParameter: {
|
@@ -7882,6 +7891,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7882
7891
|
chainId?: string | undefined;
|
7883
7892
|
mainProtocolId?: string | undefined;
|
7884
7893
|
campaigns?: boolean | undefined;
|
7894
|
+
rewardTokenSymbol?: string | undefined;
|
7885
7895
|
order?: string | undefined;
|
7886
7896
|
test?: boolean | undefined;
|
7887
7897
|
minimumTvl?: number | undefined;
|
@@ -8074,6 +8084,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8074
8084
|
chainId?: string | undefined;
|
8075
8085
|
mainProtocolId?: string | undefined;
|
8076
8086
|
campaigns?: boolean | undefined;
|
8087
|
+
rewardTokenSymbol?: string | undefined;
|
8077
8088
|
order?: string | undefined;
|
8078
8089
|
test?: boolean | undefined;
|
8079
8090
|
minimumTvl?: number | undefined;
|
@@ -8561,6 +8572,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8561
8572
|
chainId?: string | undefined;
|
8562
8573
|
mainProtocolId?: string | undefined;
|
8563
8574
|
campaigns?: boolean | undefined;
|
8575
|
+
rewardTokenSymbol?: string | undefined;
|
8564
8576
|
order?: string | undefined;
|
8565
8577
|
test?: boolean | undefined;
|
8566
8578
|
minimumTvl?: number | undefined;
|
@@ -8600,6 +8612,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8600
8612
|
chainId?: string | undefined;
|
8601
8613
|
mainProtocolId?: string | undefined;
|
8602
8614
|
campaigns?: boolean | undefined;
|
8615
|
+
rewardTokenSymbol?: string | undefined;
|
8603
8616
|
order?: string | undefined;
|
8604
8617
|
test?: boolean | undefined;
|
8605
8618
|
minimumTvl?: number | undefined;
|
@@ -8640,6 +8653,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8640
8653
|
chainId?: string | undefined;
|
8641
8654
|
mainProtocolId?: string | undefined;
|
8642
8655
|
campaigns?: boolean | undefined;
|
8656
|
+
rewardTokenSymbol?: string | undefined;
|
8643
8657
|
order?: string | undefined;
|
8644
8658
|
test?: boolean | undefined;
|
8645
8659
|
minimumTvl?: number | undefined;
|
@@ -12031,9 +12045,8 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12031
12045
|
};
|
12032
12046
|
headers: unknown;
|
12033
12047
|
response: {
|
12034
|
-
|
12035
|
-
|
12036
|
-
};
|
12048
|
+
[x: string]: any;
|
12049
|
+
200: any;
|
12037
12050
|
};
|
12038
12051
|
};
|
12039
12052
|
};
|
@@ -13185,6 +13198,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13185
13198
|
chainId?: string | undefined;
|
13186
13199
|
mainProtocolId?: string | undefined;
|
13187
13200
|
campaigns?: boolean | undefined;
|
13201
|
+
rewardTokenSymbol?: string | undefined;
|
13188
13202
|
order?: string | undefined;
|
13189
13203
|
test?: boolean | undefined;
|
13190
13204
|
minimumTvl?: number | undefined;
|
@@ -13372,6 +13386,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13372
13386
|
chainId?: string | undefined;
|
13373
13387
|
mainProtocolId?: string | undefined;
|
13374
13388
|
campaigns?: boolean | undefined;
|
13389
|
+
rewardTokenSymbol?: string | undefined;
|
13375
13390
|
order?: string | undefined;
|
13376
13391
|
test?: boolean | undefined;
|
13377
13392
|
minimumTvl?: number | undefined;
|
@@ -13574,6 +13589,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13574
13589
|
chainId?: string | undefined;
|
13575
13590
|
mainProtocolId?: string | undefined;
|
13576
13591
|
campaigns?: boolean | undefined;
|
13592
|
+
rewardTokenSymbol?: string | undefined;
|
13577
13593
|
order?: string | undefined;
|
13578
13594
|
test?: boolean | undefined;
|
13579
13595
|
minimumTvl?: number | undefined;
|
@@ -13605,6 +13621,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13605
13621
|
chainId?: string | undefined;
|
13606
13622
|
mainProtocolId?: string | undefined;
|
13607
13623
|
campaigns?: boolean | undefined;
|
13624
|
+
rewardTokenSymbol?: string | undefined;
|
13608
13625
|
order?: string | undefined;
|
13609
13626
|
test?: boolean | undefined;
|
13610
13627
|
minimumTvl?: number | undefined;
|
@@ -13636,6 +13653,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13636
13653
|
chainId?: string | undefined;
|
13637
13654
|
mainProtocolId?: string | undefined;
|
13638
13655
|
campaigns?: boolean | undefined;
|
13656
|
+
rewardTokenSymbol?: string | undefined;
|
13639
13657
|
order?: string | undefined;
|
13640
13658
|
test?: boolean | undefined;
|
13641
13659
|
minimumTvl?: number | undefined;
|
@@ -16655,6 +16673,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
16655
16673
|
chainId?: string | undefined;
|
16656
16674
|
mainProtocolId?: string | undefined;
|
16657
16675
|
campaigns?: boolean | undefined;
|
16676
|
+
rewardTokenSymbol?: string | undefined;
|
16658
16677
|
order?: string | undefined;
|
16659
16678
|
test?: boolean | undefined;
|
16660
16679
|
minimumTvl?: number | undefined;
|
@@ -16842,6 +16861,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
16842
16861
|
chainId?: string | undefined;
|
16843
16862
|
mainProtocolId?: string | undefined;
|
16844
16863
|
campaigns?: boolean | undefined;
|
16864
|
+
rewardTokenSymbol?: string | undefined;
|
16845
16865
|
order?: string | undefined;
|
16846
16866
|
test?: boolean | undefined;
|
16847
16867
|
minimumTvl?: number | undefined;
|
@@ -17044,6 +17064,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17044
17064
|
chainId?: string | undefined;
|
17045
17065
|
mainProtocolId?: string | undefined;
|
17046
17066
|
campaigns?: boolean | undefined;
|
17067
|
+
rewardTokenSymbol?: string | undefined;
|
17047
17068
|
order?: string | undefined;
|
17048
17069
|
test?: boolean | undefined;
|
17049
17070
|
minimumTvl?: number | undefined;
|
@@ -17075,6 +17096,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17075
17096
|
chainId?: string | undefined;
|
17076
17097
|
mainProtocolId?: string | undefined;
|
17077
17098
|
campaigns?: boolean | undefined;
|
17099
|
+
rewardTokenSymbol?: string | undefined;
|
17078
17100
|
order?: string | undefined;
|
17079
17101
|
test?: boolean | undefined;
|
17080
17102
|
minimumTvl?: number | undefined;
|
@@ -17106,6 +17128,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17106
17128
|
chainId?: string | undefined;
|
17107
17129
|
mainProtocolId?: string | undefined;
|
17108
17130
|
campaigns?: boolean | undefined;
|
17131
|
+
rewardTokenSymbol?: string | undefined;
|
17109
17132
|
order?: string | undefined;
|
17110
17133
|
test?: boolean | undefined;
|
17111
17134
|
minimumTvl?: number | undefined;
|
@@ -19798,9 +19821,8 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
19798
19821
|
};
|
19799
19822
|
fetch?: RequestInit | undefined;
|
19800
19823
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
19801
|
-
|
19802
|
-
|
19803
|
-
};
|
19824
|
+
[x: string]: any;
|
19825
|
+
200: any;
|
19804
19826
|
}>>;
|
19805
19827
|
};
|
19806
19828
|
campaignsForMainParameter: {
|
package/dist/src/index.d.ts
CHANGED
@@ -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;
|
@@ -4416,9 +4421,8 @@ declare const app: Elysia<"", false, {
|
|
4416
4421
|
};
|
4417
4422
|
headers: unknown;
|
4418
4423
|
response: {
|
4419
|
-
|
4420
|
-
|
4421
|
-
};
|
4424
|
+
[x: string]: any;
|
4425
|
+
200: any;
|
4422
4426
|
};
|
4423
4427
|
};
|
4424
4428
|
};
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/xU308Processor.js
CHANGED
@@ -5,16 +5,16 @@ export class xU308Processor extends GenericProcessor {
|
|
5
5
|
rounds = {
|
6
6
|
round1: [],
|
7
7
|
round2: [
|
8
|
-
{ key: "
|
9
|
-
{ key: "
|
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: "
|
13
|
-
{ key: "symbolToken1", call: "symbol", target: "
|
14
|
-
{ key: "decimalsToken0", call: "decimals", target: "
|
15
|
-
{ key: "decimalsToken1", call: "decimals", target: "
|
16
|
-
{ key: "balanceToken0", call: "balanceOf", target: "
|
17
|
-
{ key: "balanceToken1", call: "balanceOf", target: "
|
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.
|
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))) /
|
@@ -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
|
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
|
40
|
+
Campaigns: test && !creatorAddress && !rewardTokenSymbol
|
40
41
|
? undefined
|
41
42
|
: {
|
42
43
|
some: {
|
43
|
-
RewardToken:
|
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
|
102
|
-
const
|
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({
|
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)]}`);
|