@merkl/api 0.15.38 → 0.15.40
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/eden/index.d.ts +75 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +2 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/VicunaProcessor.js +12 -33
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +5 -0
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +5 -0
- package/dist/src/modules/v4/campaign/campaign.repository.js +2 -1
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +10 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +5 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +10 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +1 -1
- package/dist/src/modules/v4/router.d.ts +15 -0
- package/dist/src/modules/v4/status/status.controller.d.ts +5 -0
- package/dist/src/modules/v4/status/status.repository.d.ts +5 -0
- package/dist/src/modules/v4/status/status.repository.js +7 -0
- package/dist/src/modules/v4/status/status.service.d.ts +5 -0
- package/dist/src/utils/generateCardName.js +2 -2
- package/dist/src/utils/prices/services/coinGeckoService.d.ts +1 -1
- package/dist/src/utils/prices/services/coinGeckoService.js +18 -10
- package/dist/src/utils/prices/services/defillamaService.d.ts +1 -1
- package/dist/src/utils/prices/services/defillamaService.js +2 -2
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -727,6 +727,11 @@ declare const eden: {
|
|
727
727
|
computedUntil: bigint;
|
728
728
|
processingStarted: bigint;
|
729
729
|
};
|
730
|
+
Creator: {
|
731
|
+
tags: string[];
|
732
|
+
address: string;
|
733
|
+
creatorId: string | null;
|
734
|
+
};
|
730
735
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
731
736
|
id: string;
|
732
737
|
subType: number | null;
|
@@ -983,6 +988,11 @@ declare const eden: {
|
|
983
988
|
computedUntil: bigint;
|
984
989
|
processingStarted: bigint;
|
985
990
|
};
|
991
|
+
Creator: {
|
992
|
+
tags: string[];
|
993
|
+
address: string;
|
994
|
+
creatorId: string | null;
|
995
|
+
};
|
986
996
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
987
997
|
id: string;
|
988
998
|
subType: number | null;
|
@@ -2701,6 +2711,11 @@ declare const eden: {
|
|
2701
2711
|
computeChainId: number;
|
2702
2712
|
distributionChainId: number;
|
2703
2713
|
campaignId: string;
|
2714
|
+
RewardToken: {
|
2715
|
+
symbol: string;
|
2716
|
+
address: string;
|
2717
|
+
isTest: boolean;
|
2718
|
+
};
|
2704
2719
|
}[];
|
2705
2720
|
}>>;
|
2706
2721
|
};
|
@@ -3812,6 +3827,11 @@ declare const eden: {
|
|
3812
3827
|
computedUntil: bigint;
|
3813
3828
|
processingStarted: bigint;
|
3814
3829
|
};
|
3830
|
+
Creator: {
|
3831
|
+
tags: string[];
|
3832
|
+
address: string;
|
3833
|
+
creatorId: string | null;
|
3834
|
+
};
|
3815
3835
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
3816
3836
|
id: string;
|
3817
3837
|
subType: number | null;
|
@@ -4068,6 +4088,11 @@ declare const eden: {
|
|
4068
4088
|
computedUntil: bigint;
|
4069
4089
|
processingStarted: bigint;
|
4070
4090
|
};
|
4091
|
+
Creator: {
|
4092
|
+
tags: string[];
|
4093
|
+
address: string;
|
4094
|
+
creatorId: string | null;
|
4095
|
+
};
|
4071
4096
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
4072
4097
|
id: string;
|
4073
4098
|
subType: number | null;
|
@@ -5786,6 +5811,11 @@ declare const eden: {
|
|
5786
5811
|
computeChainId: number;
|
5787
5812
|
distributionChainId: number;
|
5788
5813
|
campaignId: string;
|
5814
|
+
RewardToken: {
|
5815
|
+
symbol: string;
|
5816
|
+
address: string;
|
5817
|
+
isTest: boolean;
|
5818
|
+
};
|
5789
5819
|
}[];
|
5790
5820
|
}>>;
|
5791
5821
|
};
|
@@ -7514,6 +7544,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7514
7544
|
computedUntil: bigint;
|
7515
7545
|
processingStarted: bigint;
|
7516
7546
|
};
|
7547
|
+
Creator: {
|
7548
|
+
tags: string[];
|
7549
|
+
address: string;
|
7550
|
+
creatorId: string | null;
|
7551
|
+
};
|
7517
7552
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
7518
7553
|
id: string;
|
7519
7554
|
subType: number | null;
|
@@ -8001,6 +8036,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8001
8036
|
computedUntil: bigint;
|
8002
8037
|
processingStarted: bigint;
|
8003
8038
|
};
|
8039
|
+
Creator: {
|
8040
|
+
tags: string[];
|
8041
|
+
address: string;
|
8042
|
+
creatorId: string | null;
|
8043
|
+
};
|
8004
8044
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
8005
8045
|
id: string;
|
8006
8046
|
subType: number | null;
|
@@ -10195,6 +10235,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
10195
10235
|
computeChainId: number;
|
10196
10236
|
distributionChainId: number;
|
10197
10237
|
campaignId: string;
|
10238
|
+
RewardToken: {
|
10239
|
+
symbol: string;
|
10240
|
+
address: string;
|
10241
|
+
isTest: boolean;
|
10242
|
+
};
|
10198
10243
|
}[];
|
10199
10244
|
};
|
10200
10245
|
};
|
@@ -12331,6 +12376,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12331
12376
|
computedUntil: bigint;
|
12332
12377
|
processingStarted: bigint;
|
12333
12378
|
};
|
12379
|
+
Creator: {
|
12380
|
+
tags: string[];
|
12381
|
+
address: string;
|
12382
|
+
creatorId: string | null;
|
12383
|
+
};
|
12334
12384
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
12335
12385
|
id: string;
|
12336
12386
|
subType: number | null;
|
@@ -12587,6 +12637,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12587
12637
|
computedUntil: bigint;
|
12588
12638
|
processingStarted: bigint;
|
12589
12639
|
};
|
12640
|
+
Creator: {
|
12641
|
+
tags: string[];
|
12642
|
+
address: string;
|
12643
|
+
creatorId: string | null;
|
12644
|
+
};
|
12590
12645
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
12591
12646
|
id: string;
|
12592
12647
|
subType: number | null;
|
@@ -14305,6 +14360,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14305
14360
|
computeChainId: number;
|
14306
14361
|
distributionChainId: number;
|
14307
14362
|
campaignId: string;
|
14363
|
+
RewardToken: {
|
14364
|
+
symbol: string;
|
14365
|
+
address: string;
|
14366
|
+
isTest: boolean;
|
14367
|
+
};
|
14308
14368
|
}[];
|
14309
14369
|
}>>;
|
14310
14370
|
};
|
@@ -15416,6 +15476,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
15416
15476
|
computedUntil: bigint;
|
15417
15477
|
processingStarted: bigint;
|
15418
15478
|
};
|
15479
|
+
Creator: {
|
15480
|
+
tags: string[];
|
15481
|
+
address: string;
|
15482
|
+
creatorId: string | null;
|
15483
|
+
};
|
15419
15484
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
15420
15485
|
id: string;
|
15421
15486
|
subType: number | null;
|
@@ -15672,6 +15737,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
15672
15737
|
computedUntil: bigint;
|
15673
15738
|
processingStarted: bigint;
|
15674
15739
|
};
|
15740
|
+
Creator: {
|
15741
|
+
tags: string[];
|
15742
|
+
address: string;
|
15743
|
+
creatorId: string | null;
|
15744
|
+
};
|
15675
15745
|
type: import("../../database/api/.generated").$Enums.CampaignType;
|
15676
15746
|
id: string;
|
15677
15747
|
subType: number | null;
|
@@ -17390,6 +17460,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17390
17460
|
computeChainId: number;
|
17391
17461
|
distributionChainId: number;
|
17392
17462
|
campaignId: string;
|
17463
|
+
RewardToken: {
|
17464
|
+
symbol: string;
|
17465
|
+
address: string;
|
17466
|
+
isTest: boolean;
|
17467
|
+
};
|
17393
17468
|
}[];
|
17394
17469
|
}>>;
|
17395
17470
|
};
|
package/dist/src/index.d.ts
CHANGED
@@ -646,6 +646,11 @@ declare const app: Elysia<"", false, {
|
|
646
646
|
computedUntil: bigint;
|
647
647
|
processingStarted: bigint;
|
648
648
|
};
|
649
|
+
Creator: {
|
650
|
+
tags: string[];
|
651
|
+
address: string;
|
652
|
+
creatorId: string | null;
|
653
|
+
};
|
649
654
|
type: import("../database/api/.generated").$Enums.CampaignType;
|
650
655
|
id: string;
|
651
656
|
subType: number | null;
|
@@ -1133,6 +1138,11 @@ declare const app: Elysia<"", false, {
|
|
1133
1138
|
computedUntil: bigint;
|
1134
1139
|
processingStarted: bigint;
|
1135
1140
|
};
|
1141
|
+
Creator: {
|
1142
|
+
tags: string[];
|
1143
|
+
address: string;
|
1144
|
+
creatorId: string | null;
|
1145
|
+
};
|
1136
1146
|
type: import("../database/api/.generated").$Enums.CampaignType;
|
1137
1147
|
id: string;
|
1138
1148
|
subType: number | null;
|
@@ -3327,6 +3337,11 @@ declare const app: Elysia<"", false, {
|
|
3327
3337
|
computeChainId: number;
|
3328
3338
|
distributionChainId: number;
|
3329
3339
|
campaignId: string;
|
3340
|
+
RewardToken: {
|
3341
|
+
symbol: string;
|
3342
|
+
address: string;
|
3343
|
+
isTest: boolean;
|
3344
|
+
};
|
3330
3345
|
}[];
|
3331
3346
|
};
|
3332
3347
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { merklChainDataWithCache } from "../../merklChainData";
|
2
2
|
import { TokenRepository } from "../../../modules/v4/token/token.repository";
|
3
3
|
import { log } from "../../../utils/logger";
|
4
|
-
import { BN2Number, BalancerPoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, } from "@sdk";
|
4
|
+
import { BN2Number, BalancerPoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, getEnv, } from "@sdk";
|
5
5
|
import { Pricer } from "../../../utils/pricer";
|
6
6
|
import { getLastEligibilityRatio } from "../utils/getLastEligibilityRatio";
|
7
7
|
import { getTVL } from "./ERC20SubTypes/helpers/getTVL";
|
@@ -118,7 +118,7 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
118
118
|
const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
|
119
119
|
tokenTypesByCampaign[campaign.campaignId] = await getTokenPricesInfo(i, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, result, campaign, pricer);
|
120
120
|
try {
|
121
|
-
if (!!tokenTypesByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken)
|
121
|
+
if (!!tokenTypesByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken && getEnv() === "prod")
|
122
122
|
await TokenRepository.updateAddressPrices(campaign.campaignParameters.targetToken, tokenTypesByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken);
|
123
123
|
}
|
124
124
|
catch (e) {
|
@@ -1,6 +1,14 @@
|
|
1
1
|
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
2
|
import axios from "axios";
|
3
3
|
import { GenericProcessor } from "./GenericProcessor";
|
4
|
+
const findTvlByVaultAddress = (data, targetVaultAddress) => {
|
5
|
+
for (const key in data) {
|
6
|
+
if (data[key].vaultAddress.toLowerCase() === targetVaultAddress.toLowerCase()) {
|
7
|
+
return data[key].tvl;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
return null;
|
11
|
+
};
|
4
12
|
export class VicunaProcessor extends GenericProcessor {
|
5
13
|
rounds = {
|
6
14
|
round1: [],
|
@@ -10,39 +18,10 @@ export class VicunaProcessor extends GenericProcessor {
|
|
10
18
|
};
|
11
19
|
async processingRound5(_index, type, typeInfo, _calls, campaign, _pricer) {
|
12
20
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
13
|
-
const vicunaTVL = (await axios("https://vicuna.orthae.xyz/tvl")).data;
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
const mapping = {
|
18
|
-
"swapx-os-ws": "swapx-ichi-ws-os-ws",
|
19
|
-
"swapx-scusd-usdc": "swapx-ichi-usdc-scusd-usdc",
|
20
|
-
"swapx-sts-ws": "swapx-ichi-ws-sts-ws",
|
21
|
-
"swapx-sacra-ws": "swapx-ichi-ws-sacra-sacra",
|
22
|
-
"solidly-swapx-ws-eco": "swapx-ws-eco",
|
23
|
-
"solidly-swapx-ws-goglz": "swapx-ws-goglz",
|
24
|
-
"solidly-swapx-ws-hedgy": "swapx-ws-hedgy",
|
25
|
-
"solidly-swapx-ws-tysg": "swapx-ws-tysg",
|
26
|
-
"solidly-swapx-ws-sdog": "swapx-ws-sdog",
|
27
|
-
"solidly-swapx-ws-shiba": "swapx-ws-shiba",
|
28
|
-
"balancer-ws-sts": "beets-ws-sts",
|
29
|
-
"balancer-scusd-sts": "beets-usdc-scusd",
|
30
|
-
"swapx-ws-swpx": "swapx-ichi-ws-swapx-ws",
|
31
|
-
"swapx-ws-usdc": "swapx-ichi-ws-usdc-ws",
|
32
|
-
"swapx-ws-sceth": "swapx-ichi-ws-sceth-ws",
|
33
|
-
"swapx-ws-sts": "swapx-ichi-ws-sts-sts",
|
34
|
-
"swapx-ws-weth": "swapx-ichi-ws-weth-ws",
|
35
|
-
"swapx-ws-os": "swapx-ichi-ws-os-os",
|
36
|
-
"swapx-usdc-swpx": "swapx-ichi-usdc-swapx-usdc",
|
37
|
-
"swapx-usdc-weth": "swapx-ichi-usdc-weth-weth",
|
38
|
-
"swapx-usdc-scusd": "swapx-ichi-usdc-scusd-usdc",
|
39
|
-
"swapx-usdc-sts": "swapx-ichi-usdc-sts-usdc",
|
40
|
-
"swapx-weth-usdc": "swapx-ichi-usdc-weth-usdc",
|
41
|
-
};
|
42
|
-
if (!!mapping[parsedNameForAPI]) {
|
43
|
-
parsedNameForAPI = mapping[parsedNameForAPI];
|
44
|
-
}
|
45
|
-
const tvl = vicunaTVL[campaign.computeChainId][parsedNameForAPI];
|
21
|
+
const vicunaTVL = (await axios("https://vicuna.orthae.xyz/tvl/details")).data;
|
22
|
+
// find the entry that matches the vault address
|
23
|
+
const tvl = findTvlByVaultAddress(vicunaTVL[campaign.chainId], typeInfo.tokenAddress) ?? 0;
|
24
|
+
console.log("tvl", tvl);
|
46
25
|
const priceTargetToken = tvl / totalSupply;
|
47
26
|
return {
|
48
27
|
...typeInfo,
|
@@ -164,6 +164,11 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
164
164
|
computedUntil: bigint;
|
165
165
|
processingStarted: bigint;
|
166
166
|
};
|
167
|
+
Creator: {
|
168
|
+
tags: string[];
|
169
|
+
address: string;
|
170
|
+
creatorId: string | null;
|
171
|
+
};
|
167
172
|
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
168
173
|
id: string;
|
169
174
|
subType: number | null;
|
@@ -155,6 +155,11 @@ export declare abstract class CampaignRepository {
|
|
155
155
|
computedUntil: bigint;
|
156
156
|
processingStarted: bigint;
|
157
157
|
}[];
|
158
|
+
Creator: {
|
159
|
+
tags: string[];
|
160
|
+
address: string;
|
161
|
+
creatorId: string | null;
|
162
|
+
};
|
158
163
|
ComputeChain: {
|
159
164
|
name: string;
|
160
165
|
id: number;
|
@@ -276,7 +276,7 @@ export class CampaignRepository {
|
|
276
276
|
}
|
277
277
|
// ─── Search Many Campaigns ───────────────────────────────────────────
|
278
278
|
static async findMany(query) {
|
279
|
-
const { page: _page, items: _items, ...
|
279
|
+
const { page: _page, items: _items, ..._filters } = query;
|
280
280
|
const page = _page ? _page : 0;
|
281
281
|
const items = _items ? _items : 20;
|
282
282
|
const args = CampaignRepository.transformQueryToPrismaFilters(query);
|
@@ -288,6 +288,7 @@ export class CampaignRepository {
|
|
288
288
|
ComputeChain: true,
|
289
289
|
RewardToken: true,
|
290
290
|
CampaignStatus: true,
|
291
|
+
Creator: true,
|
291
292
|
},
|
292
293
|
orderBy: {
|
293
294
|
endTimestamp: "desc",
|
@@ -78,6 +78,11 @@ export declare abstract class CampaignService {
|
|
78
78
|
computedUntil: bigint;
|
79
79
|
processingStarted: bigint;
|
80
80
|
};
|
81
|
+
Creator: {
|
82
|
+
tags: string[];
|
83
|
+
address: string;
|
84
|
+
creatorId: string | null;
|
85
|
+
};
|
81
86
|
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
82
87
|
id: string;
|
83
88
|
subType: number | null;
|
@@ -219,6 +224,11 @@ export declare abstract class CampaignService {
|
|
219
224
|
computedUntil: bigint;
|
220
225
|
processingStarted: bigint;
|
221
226
|
};
|
227
|
+
Creator: {
|
228
|
+
tags: string[];
|
229
|
+
address: string;
|
230
|
+
creatorId: string | null;
|
231
|
+
};
|
222
232
|
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
223
233
|
id: string;
|
224
234
|
subType: number | null;
|
@@ -501,6 +501,11 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
501
501
|
computedUntil: bigint;
|
502
502
|
processingStarted: bigint;
|
503
503
|
};
|
504
|
+
Creator: {
|
505
|
+
tags: string[];
|
506
|
+
address: string;
|
507
|
+
creatorId: string | null;
|
508
|
+
};
|
504
509
|
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
505
510
|
id: string;
|
506
511
|
subType: number | null;
|
@@ -240,6 +240,11 @@ export declare abstract class OpportunityService {
|
|
240
240
|
computedUntil: bigint;
|
241
241
|
processingStarted: bigint;
|
242
242
|
};
|
243
|
+
Creator: {
|
244
|
+
tags: string[];
|
245
|
+
address: string;
|
246
|
+
creatorId: string | null;
|
247
|
+
};
|
243
248
|
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
244
249
|
id: string;
|
245
250
|
subType: number | null;
|
@@ -470,6 +475,11 @@ export declare abstract class OpportunityService {
|
|
470
475
|
computedUntil: bigint;
|
471
476
|
processingStarted: bigint;
|
472
477
|
};
|
478
|
+
Creator: {
|
479
|
+
tags: string[];
|
480
|
+
address: string;
|
481
|
+
creatorId: string | null;
|
482
|
+
};
|
473
483
|
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
474
484
|
id: string;
|
475
485
|
subType: number | null;
|
@@ -3611,7 +3611,7 @@ const PufferInterfaceCampaigns = {
|
|
3611
3611
|
marketId: "0xa42ba90e4d3013dee8eb0d7bb7ae0817297337eeecd525dbdd48c7b5c5e6988d",
|
3612
3612
|
},
|
3613
3613
|
[pufferCampaigns.pufETH_hold]: {
|
3614
|
-
campaignType: Campaign.
|
3614
|
+
campaignType: Campaign.ERC20LOGPROCESSOR,
|
3615
3615
|
computeChainId: ChainId.MAINNET,
|
3616
3616
|
hooks: [],
|
3617
3617
|
targetToken: "0xD9A442856C234a39a81a089C06451EBAa4306a72",
|
@@ -516,6 +516,11 @@ export declare const v4: Elysia<"/v4", false, {
|
|
516
516
|
computedUntil: bigint;
|
517
517
|
processingStarted: bigint;
|
518
518
|
};
|
519
|
+
Creator: {
|
520
|
+
tags: string[];
|
521
|
+
address: string;
|
522
|
+
creatorId: string | null;
|
523
|
+
};
|
519
524
|
type: import("../../../database/api/.generated").$Enums.CampaignType;
|
520
525
|
id: string;
|
521
526
|
subType: number | null;
|
@@ -1003,6 +1008,11 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1003
1008
|
computedUntil: bigint;
|
1004
1009
|
processingStarted: bigint;
|
1005
1010
|
};
|
1011
|
+
Creator: {
|
1012
|
+
tags: string[];
|
1013
|
+
address: string;
|
1014
|
+
creatorId: string | null;
|
1015
|
+
};
|
1006
1016
|
type: import("../../../database/api/.generated").$Enums.CampaignType;
|
1007
1017
|
id: string;
|
1008
1018
|
subType: number | null;
|
@@ -3197,6 +3207,11 @@ export declare const v4: Elysia<"/v4", false, {
|
|
3197
3207
|
computeChainId: number;
|
3198
3208
|
distributionChainId: number;
|
3199
3209
|
campaignId: string;
|
3210
|
+
RewardToken: {
|
3211
|
+
symbol: string;
|
3212
|
+
address: string;
|
3213
|
+
isTest: boolean;
|
3214
|
+
};
|
3200
3215
|
}[];
|
3201
3216
|
};
|
3202
3217
|
};
|
@@ -146,6 +146,11 @@ export declare const StatusController: Elysia<"/campaign-status", false, {
|
|
146
146
|
computeChainId: number;
|
147
147
|
distributionChainId: number;
|
148
148
|
campaignId: string;
|
149
|
+
RewardToken: {
|
150
|
+
symbol: string;
|
151
|
+
address: string;
|
152
|
+
isTest: boolean;
|
153
|
+
};
|
149
154
|
}[];
|
150
155
|
};
|
151
156
|
};
|
@@ -97,6 +97,13 @@ export class StatusRepository {
|
|
97
97
|
startTimestamp: true,
|
98
98
|
endTimestamp: true,
|
99
99
|
distributionChainId: true,
|
100
|
+
RewardToken: {
|
101
|
+
select: {
|
102
|
+
address: true,
|
103
|
+
symbol: true,
|
104
|
+
isTest: true,
|
105
|
+
},
|
106
|
+
},
|
100
107
|
Opportunity: {
|
101
108
|
select: {
|
102
109
|
name: true,
|
@@ -149,8 +149,8 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
|
|
149
149
|
switch (typeInfo.tokenAddress) {
|
150
150
|
case "0x3a8099D8FE5C072bB035381003993393072D3ec7":
|
151
151
|
return "Hold pufETH on DeSyn (dpufETH)";
|
152
|
-
case "0x1f2aa9680910aC5a4527FA72001dC249943f60b4
|
153
|
-
return "Hold pufETH on Karak
|
152
|
+
case "0x1f2aa9680910aC5a4527FA72001dC249943f60b4":
|
153
|
+
return "Hold pufETH on Karak";
|
154
154
|
default:
|
155
155
|
return `Hold ${typeInfo.name} (${campaign.campaignParameters.symbolTargetToken})`;
|
156
156
|
}
|
@@ -9,7 +9,7 @@ export default class CoingeckoService {
|
|
9
9
|
const filteredTokens = tickers.filter(tokenPriceSource => tokenPriceSource.method === PriceSourceMethod.COINGECKO);
|
10
10
|
if (filteredTokens.length === 0)
|
11
11
|
return [];
|
12
|
-
return await this.
|
12
|
+
return await this.fetchPrices(filteredTokens);
|
13
13
|
}
|
14
14
|
buildUrl(tokens) {
|
15
15
|
const tikerParams = tokens
|
@@ -22,15 +22,23 @@ export default class CoingeckoService {
|
|
22
22
|
.join(",");
|
23
23
|
return this.baseUrl.concat(tikerParams);
|
24
24
|
}
|
25
|
-
async
|
26
|
-
const
|
27
|
-
|
28
|
-
|
29
|
-
.
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
25
|
+
async fetchPrices(tickers) {
|
26
|
+
const chunkSize = 200;
|
27
|
+
const chunks = [];
|
28
|
+
for (let i = 0; i < tickers.length; i += chunkSize) {
|
29
|
+
chunks.push(tickers.slice(i, Math.min(tickers.length, i + chunkSize)));
|
30
|
+
}
|
31
|
+
const promises = await Promise.all(chunks.map(async (chunk) => {
|
32
|
+
const url = this.buildUrl(chunk);
|
33
|
+
return axios
|
34
|
+
.get(url, { timeout: 10000 })
|
35
|
+
.then(res => this.formatResponse(res, chunk))
|
36
|
+
.catch(err => {
|
37
|
+
log.error("❌ CoingeckoService not responding", err);
|
38
|
+
throw "❌ CoingeckoService not responding";
|
39
|
+
});
|
40
|
+
}));
|
41
|
+
return promises.reduce((acc, val) => acc.concat(val), []);
|
34
42
|
}
|
35
43
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation> Need to be typed according to coinguekko answer type
|
36
44
|
formatResponse(data, tokens) {
|
@@ -9,7 +9,7 @@ export default class DefillamaService {
|
|
9
9
|
const filteredTokens = sources.filter(tokenPriceSource => tokenPriceSource.method === PriceSourceMethod.DEFILLAMA);
|
10
10
|
if (filteredTokens.length === 0)
|
11
11
|
return [];
|
12
|
-
return await this.
|
12
|
+
return await this.fetchPrices(filteredTokens);
|
13
13
|
}
|
14
14
|
buildUrl(tokens) {
|
15
15
|
const tikerParams = tokens
|
@@ -22,7 +22,7 @@ export default class DefillamaService {
|
|
22
22
|
.join(",");
|
23
23
|
return this.baseUrl.concat(tikerParams);
|
24
24
|
}
|
25
|
-
async
|
25
|
+
async fetchPrices(sources) {
|
26
26
|
const url = this.buildUrl(sources);
|
27
27
|
return axios
|
28
28
|
.get(url, { timeout: 10000 })
|