@merkl/api 0.16.12 → 0.16.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/backgroundJobs/jobs/priceUpdater.js +1 -1
- package/dist/src/eden/index.d.ts +90 -410
- package/dist/src/entities/opportunity.js +17 -0
- package/dist/src/index.d.ts +22 -82
- package/dist/src/libs/campaigns/campaignTypes/EncompassingDynamicData.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/EncompassingDynamicData.js +34 -0
- package/dist/src/libs/campaigns/campaignsDynamicData.js +4 -0
- package/dist/src/libs/merklChainData.js +1 -1
- package/dist/src/libs/tokens/balances.js +1 -1
- package/dist/src/modules/v4/accounting/accounting.service.js +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +1 -13
- package/dist/src/modules/v4/campaign/campaign.repository.js +2 -2
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +2 -26
- package/dist/src/modules/v4/campaign/campaign.service.js +3 -3
- package/dist/src/modules/v4/claims/claims.controller.d.ts +1 -1
- package/dist/src/modules/v4/enso/enso.model.d.ts +1 -1
- package/dist/src/modules/v4/enso/enso.model.js +1 -1
- package/dist/src/modules/v4/enso/enso.service.d.ts +2 -2
- package/dist/src/modules/v4/enso/enso.service.js +2 -2
- package/dist/src/modules/v4/interaction/interaction.model.d.ts +1 -1
- package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +1 -1
- package/dist/src/modules/v4/kyberzap/kyberzap.service.js +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +4 -40
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +12 -108
- package/dist/src/modules/v4/opportunity/opportunity.service.js +8 -5
- package/dist/src/modules/v4/opportunity/subservices/getAjnaMetadata.service.js +1 -1
- package/dist/src/modules/v4/opportunity/subservices/getBadgerMetadata.service.js +1 -1
- package/dist/src/modules/v4/opportunity/subservices/getEncompassingMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getEncompassingMetadata.service.js +35 -0
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.model.js +4 -0
- package/dist/src/modules/v4/protocol/protocol.service.js +6 -2
- package/dist/src/modules/v4/reward/reward.controller.js +3 -3
- package/dist/src/modules/v4/reward/reward.repository.js +2 -2
- package/dist/src/modules/v4/reward/reward.service.js +1 -1
- package/dist/src/modules/v4/router.d.ts +22 -82
- package/dist/src/modules/v4/token/token.controller.d.ts +16 -28
- package/dist/src/modules/v4/token/token.controller.js +2 -1
- package/dist/src/modules/v4/token/token.service.d.ts +5 -69
- package/dist/src/routes/v3/lostyield.js +1 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/modules/v4/token/index.d.ts +0 -3
- package/dist/src/modules/v4/token/index.js +0 -3
@@ -34,7 +34,7 @@ export declare abstract class OpportunityService {
|
|
34
34
|
name: string;
|
35
35
|
status: "SOON";
|
36
36
|
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
37
|
-
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
37
|
+
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
38
38
|
depositUrl: any;
|
39
39
|
tags: string[];
|
40
40
|
}>;
|
@@ -46,20 +46,8 @@ export declare abstract class OpportunityService {
|
|
46
46
|
name: string;
|
47
47
|
status: "PAST" | "LIVE" | "SOON";
|
48
48
|
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
49
|
-
tokens:
|
50
|
-
|
51
|
-
name: string | null;
|
52
|
-
id: string;
|
53
|
-
icon: string;
|
54
|
-
chainId: number;
|
55
|
-
address: string;
|
56
|
-
decimals: number;
|
57
|
-
verified: boolean;
|
58
|
-
isTest: boolean;
|
59
|
-
} & {
|
60
|
-
price?: number | null | undefined;
|
61
|
-
})[];
|
62
|
-
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
49
|
+
tokens: any[];
|
50
|
+
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
63
51
|
depositUrl: any;
|
64
52
|
tags: string[];
|
65
53
|
}>;
|
@@ -83,7 +71,7 @@ export declare abstract class OpportunityService {
|
|
83
71
|
verified: boolean;
|
84
72
|
isTest: boolean;
|
85
73
|
}[];
|
86
|
-
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
74
|
+
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
87
75
|
depositUrl: string | undefined;
|
88
76
|
tags: string[];
|
89
77
|
}>;
|
@@ -98,20 +86,8 @@ export declare abstract class OpportunityService {
|
|
98
86
|
name: string;
|
99
87
|
status: "PAST" | "LIVE" | "SOON";
|
100
88
|
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
101
|
-
tokens:
|
102
|
-
|
103
|
-
name: string | null;
|
104
|
-
id: string;
|
105
|
-
icon: string;
|
106
|
-
chainId: number;
|
107
|
-
address: string;
|
108
|
-
decimals: number;
|
109
|
-
verified: boolean;
|
110
|
-
isTest: boolean;
|
111
|
-
} & {
|
112
|
-
price?: number | null | undefined;
|
113
|
-
})[];
|
114
|
-
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
89
|
+
tokens: any[];
|
90
|
+
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
115
91
|
depositUrl: any;
|
116
92
|
tags: string[];
|
117
93
|
}>;
|
@@ -214,19 +190,7 @@ export declare abstract class OpportunityService {
|
|
214
190
|
id: number;
|
215
191
|
icon: string;
|
216
192
|
};
|
217
|
-
rewardToken:
|
218
|
-
symbol: string;
|
219
|
-
name: string | null;
|
220
|
-
id: string;
|
221
|
-
icon: string;
|
222
|
-
chainId: number;
|
223
|
-
address: string;
|
224
|
-
decimals: number;
|
225
|
-
verified: boolean;
|
226
|
-
isTest: boolean;
|
227
|
-
} & {
|
228
|
-
price?: number | null | undefined;
|
229
|
-
};
|
193
|
+
rewardToken: Token;
|
230
194
|
distributionChain: {
|
231
195
|
name: string;
|
232
196
|
id: number;
|
@@ -318,19 +282,7 @@ export declare abstract class OpportunityService {
|
|
318
282
|
};
|
319
283
|
id: string;
|
320
284
|
depositUrl: string | undefined;
|
321
|
-
tokens:
|
322
|
-
symbol: string;
|
323
|
-
name: string | null;
|
324
|
-
id: string;
|
325
|
-
icon: string;
|
326
|
-
chainId: number;
|
327
|
-
address: string;
|
328
|
-
decimals: number;
|
329
|
-
verified: boolean;
|
330
|
-
isTest: boolean;
|
331
|
-
} & {
|
332
|
-
price?: number | null | undefined;
|
333
|
-
})[];
|
285
|
+
tokens: Token[];
|
334
286
|
chain: {
|
335
287
|
name: string;
|
336
288
|
id: number;
|
@@ -406,19 +358,7 @@ export declare abstract class OpportunityService {
|
|
406
358
|
};
|
407
359
|
id: string;
|
408
360
|
depositUrl: string | undefined;
|
409
|
-
tokens:
|
410
|
-
symbol: string;
|
411
|
-
name: string | null;
|
412
|
-
id: string;
|
413
|
-
icon: string;
|
414
|
-
chainId: number;
|
415
|
-
address: string;
|
416
|
-
decimals: number;
|
417
|
-
verified: boolean;
|
418
|
-
isTest: boolean;
|
419
|
-
} & {
|
420
|
-
price?: number | null | undefined;
|
421
|
-
})[];
|
361
|
+
tokens: Token[];
|
422
362
|
chain: {
|
423
363
|
name: string;
|
424
364
|
id: number;
|
@@ -449,19 +389,7 @@ export declare abstract class OpportunityService {
|
|
449
389
|
id: number;
|
450
390
|
icon: string;
|
451
391
|
};
|
452
|
-
rewardToken:
|
453
|
-
symbol: string;
|
454
|
-
name: string | null;
|
455
|
-
id: string;
|
456
|
-
icon: string;
|
457
|
-
chainId: number;
|
458
|
-
address: string;
|
459
|
-
decimals: number;
|
460
|
-
verified: boolean;
|
461
|
-
isTest: boolean;
|
462
|
-
} & {
|
463
|
-
price?: number | null | undefined;
|
464
|
-
};
|
392
|
+
rewardToken: Token;
|
465
393
|
distributionChain: {
|
466
394
|
name: string;
|
467
395
|
id: number;
|
@@ -556,19 +484,7 @@ export declare abstract class OpportunityService {
|
|
556
484
|
};
|
557
485
|
id: string;
|
558
486
|
depositUrl: string | undefined;
|
559
|
-
tokens:
|
560
|
-
symbol: string;
|
561
|
-
name: string | null;
|
562
|
-
id: string;
|
563
|
-
icon: string;
|
564
|
-
chainId: number;
|
565
|
-
address: string;
|
566
|
-
decimals: number;
|
567
|
-
verified: boolean;
|
568
|
-
isTest: boolean;
|
569
|
-
} & {
|
570
|
-
price?: number | null | undefined;
|
571
|
-
})[];
|
487
|
+
tokens: Token[];
|
572
488
|
chain: {
|
573
489
|
name: string;
|
574
490
|
id: number;
|
@@ -595,19 +511,7 @@ export declare abstract class OpportunityService {
|
|
595
511
|
static formatResponseBase(opportunity: LightOpportunityFromDB): {
|
596
512
|
id: string;
|
597
513
|
depositUrl: string | undefined;
|
598
|
-
tokens:
|
599
|
-
symbol: string;
|
600
|
-
name: string | null;
|
601
|
-
id: string;
|
602
|
-
icon: string;
|
603
|
-
chainId: number;
|
604
|
-
address: string;
|
605
|
-
decimals: number;
|
606
|
-
verified: boolean;
|
607
|
-
isTest: boolean;
|
608
|
-
} & {
|
609
|
-
price?: number | null | undefined;
|
610
|
-
})[];
|
514
|
+
tokens: Token[];
|
611
515
|
chain: {
|
612
516
|
name: string;
|
613
517
|
id: number;
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { NotFoundError } from "../../../errors";
|
2
|
+
import { TTLPresets } from "../cache/cache.model";
|
3
|
+
import { CacheService } from "../cache/cache.service";
|
2
4
|
import { CampaignService } from "../campaign";
|
5
|
+
import { CampaignRepository } from "../campaign/campaign.repository";
|
6
|
+
import { TokenService } from "../token/token.service";
|
7
|
+
import { UserService } from "../user/user.service";
|
3
8
|
import { log } from "../../../utils/logger";
|
4
9
|
import { OpportunityAction, Prisma, Status } from "../../../../database/api/.generated";
|
5
10
|
import { record } from "@elysiajs/opentelemetry";
|
6
11
|
import { Campaign as CampaignEnum } from "@sdk";
|
7
12
|
import moment from "moment";
|
8
|
-
import { CacheService } from "../cache";
|
9
|
-
import { TTLPresets } from "../cache/cache.model";
|
10
|
-
import { CampaignRepository } from "../campaign/campaign.repository";
|
11
|
-
import { TokenService } from "../token";
|
12
|
-
import { UserService } from "../user";
|
13
13
|
import { OpportunityRepository } from "./opportunity.repository";
|
14
14
|
import { getAjnaMetadata } from "./subservices/getAjnaMetadata.service";
|
15
15
|
import { getAmbientMetadata } from "./subservices/getAmbientMetadata.service";
|
@@ -18,6 +18,7 @@ import { getClammMetadata } from "./subservices/getClammMetadata.service";
|
|
18
18
|
import { getCompoundMetadata } from "./subservices/getCompoundMetadata.service";
|
19
19
|
import { getDolomiteMetadata } from "./subservices/getDolomiteMetadata.service";
|
20
20
|
import { getEigenLayerMetadata } from "./subservices/getEigenLayerMetadata.service";
|
21
|
+
import { getEncompassingMetadata } from "./subservices/getEncompassingMetadata.service";
|
21
22
|
import { getErc20Metadata } from "./subservices/getErc20Metadata.service";
|
22
23
|
import { getErc20SnapshotMetadata } from "./subservices/getErc20SnapshotMetadata.service";
|
23
24
|
import { getEulerMetadata } from "./subservices/getEulerMetadata.service";
|
@@ -96,6 +97,8 @@ export class OpportunityService {
|
|
96
97
|
return getAmbientMetadata(chainId, campaignParams);
|
97
98
|
case "UNISWAP_V4":
|
98
99
|
return getUniswapV4Metadata(chainId, campaignParams);
|
100
|
+
case "ENCOMPASSING":
|
101
|
+
return getEncompassingMetadata(chainId, campaign.rewardTokenAddress, campaignParams);
|
99
102
|
case "INVALID":
|
100
103
|
return {
|
101
104
|
name: "Invalid Campaigns",
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import { TokenService } from "../../token/token.service";
|
1
2
|
import { OpportunityAction } from "../../../../../database/api/.generated";
|
2
|
-
import { TokenService } from "../../token";
|
3
3
|
export const getAjnaMetadata = async (chainId, campaignSubType, params) => {
|
4
4
|
try {
|
5
5
|
const [collateral, quote] = await TokenService.getManyOrCreate([
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import { TokenService } from "../../token/token.service";
|
1
2
|
import { OpportunityAction } from "../../../../../database/api/.generated";
|
2
|
-
import { TokenService } from "../../token";
|
3
3
|
export const getBadgerMetadata = async (chainId, params) => {
|
4
4
|
try {
|
5
5
|
const [token] = await TokenService.getManyOrCreate([{ chainId, address: params.targetToken }]);
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { ChainId, EncompassingCampaign } from "@sdk";
|
2
|
+
import type { OpportunityMetadata } from "../opportunity.model";
|
3
|
+
export declare const getEncompassingMetadata: (chainId: ChainId, rewardTokenAddress: string, params: EncompassingCampaign["campaignParameters"]) => Promise<OpportunityMetadata>;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { log } from "../../../../utils/logger";
|
2
|
+
import { OpportunityAction } from "../../../../../database/api/.generated";
|
3
|
+
export const getEncompassingMetadata = async (chainId, rewardTokenAddress, params) => {
|
4
|
+
try {
|
5
|
+
const dataResponse = await fetch(params.dataUrl);
|
6
|
+
if (!dataResponse.ok)
|
7
|
+
throw new Error(`Response status: ${dataResponse.status}`);
|
8
|
+
const data = await dataResponse.json();
|
9
|
+
return {
|
10
|
+
action: OpportunityAction.DROP,
|
11
|
+
name: data.opportunityName ?? `Distribution of ${params.symbolRewardToken}`,
|
12
|
+
tokens: [
|
13
|
+
{
|
14
|
+
chainId,
|
15
|
+
address: rewardTokenAddress,
|
16
|
+
},
|
17
|
+
],
|
18
|
+
mainProtocol: data.mainProtocol ?? undefined,
|
19
|
+
};
|
20
|
+
}
|
21
|
+
catch (err) {
|
22
|
+
log.error("failed to fetch data from dataUrl", err);
|
23
|
+
return {
|
24
|
+
action: OpportunityAction.DROP,
|
25
|
+
name: `Distribution of ${params.symbolRewardToken}`,
|
26
|
+
tokens: [
|
27
|
+
{
|
28
|
+
chainId,
|
29
|
+
address: rewardTokenAddress,
|
30
|
+
},
|
31
|
+
],
|
32
|
+
mainProtocol: undefined,
|
33
|
+
};
|
34
|
+
}
|
35
|
+
};
|
@@ -9,7 +9,7 @@ export type Protocol = Resource<"Protocol", undefined, {
|
|
9
9
|
numberOfLiveCampaigns?: number;
|
10
10
|
opportunityLiveTags?: string[];
|
11
11
|
}>;
|
12
|
-
declare const protocolTypes: readonly ["ambient", "arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap-v3", "quickswap-algebra", "quickswap-uni", "ramses", "retro", "stryke", "stryke-pcs", "stryke-sushi", "sushiswap-v3", "swapr", "thruster", "uniswap-v3", "voltage", "zero", "koi", "supswap-v3", "zkswap", "thirdtrade", "uniswapv4", "uniswap-v2", "velodrome", "aerodrome", "balancer", "curve", "cross_curve", "curveNPool", "aura", "akron", "beefy", "dragonswap", "poolside", "koi", "syncswap-v3", "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"];
|
12
|
+
declare const protocolTypes: readonly ["ambient", "arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap-v3", "quickswap-algebra", "quickswap-uni", "ramses", "retro", "stryke", "stryke-pcs", "stryke-sushi", "sushiswap-v3", "swapr", "thruster", "uniswap-v3", "voltage", "zero", "koi", "supswap-v3", "zkswap", "thirdtrade", "uniswapv4", "uniswap-v2", "velodrome", "aerodrome", "balancer", "curve", "cross_curve", "curveNPool", "aura", "akron", "beefy", "dragonswap", "poolside", "koi", "syncswap-v3", "neptune", "zkSwapThreePool", "syncswap", "rfx", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank", "ion", "venus", "woofi", "reactor_fusion", "eigenlayer", "vest", "zerolend", "hyperdrive", "gamma", "oku", "hourglass", "veda", "kyo", "sonex", "quickswap-algebra", "velodrome"];
|
13
13
|
export type ProtocolId = (typeof protocolTypes)[number];
|
14
14
|
export declare const ProtocolResourceDto: import("@sinclair/typebox").TObject<{
|
15
15
|
id: import("@sinclair/typebox").TString;
|
@@ -78,6 +78,10 @@ const protocolTypes = [
|
|
78
78
|
"oku",
|
79
79
|
"hourglass",
|
80
80
|
"veda",
|
81
|
+
"kyo",
|
82
|
+
"sonex",
|
83
|
+
"quickswap-algebra",
|
84
|
+
"velodrome",
|
81
85
|
];
|
82
86
|
// ─── DTOs ────────────────────────────────────────────────────────────────────
|
83
87
|
export const ProtocolResourceDto = t.Object({
|
@@ -1,7 +1,7 @@
|
|
1
|
+
import { ChainService } from "../chain/chain.service";
|
2
|
+
import { TokenService } from "../token/token.service";
|
1
3
|
import { log } from "../../../utils/logger";
|
2
4
|
import { AMM as AMMV3 } from "@sdk";
|
3
|
-
import { ChainService } from "../chain";
|
4
|
-
import { TokenService } from "../token";
|
5
5
|
import { ProtocolRepository } from "./protocol.repository";
|
6
6
|
// ─── Protocols Services ──────────────────────────────────────────────────────
|
7
7
|
export class ProtocolService {
|
@@ -36,6 +36,10 @@ export class ProtocolService {
|
|
36
36
|
[AMMV3.ThirdTrade]: "thirdtrade",
|
37
37
|
[AMMV3.SyncswapV3]: "syncswap",
|
38
38
|
[AMMV3.Neptune]: "neptune",
|
39
|
+
[AMMV3.KYO]: "kyo",
|
40
|
+
[AMMV3.Sonex]: "sonex",
|
41
|
+
[AMMV3.QuickswapAlgebraV1_2]: "quickswap-algebra",
|
42
|
+
[AMMV3.Velodrome]: "velodrome",
|
39
43
|
}[amm];
|
40
44
|
}
|
41
45
|
static async findMany(query) {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
2
2
|
import { AuthorizationHeadersDto, EngineGuard } from "../../../guards/Engine.guard";
|
3
|
+
import { ChainDto } from "../accounting/accounting.model";
|
4
|
+
import { CampaignService } from "../campaign/campaign.service";
|
5
|
+
import { TokenService } from "../token/token.service";
|
3
6
|
import { throwOnInvalidRequiredAddress, throwOnUnsupportedChainId } from "../../../utils/throw";
|
4
7
|
import Elysia from "elysia";
|
5
|
-
import { ChainDto } from "../accounting";
|
6
|
-
import { CampaignService } from "../campaign";
|
7
|
-
import { TokenService } from "../token";
|
8
8
|
import { CampaignIdDto, CampaignIdWithoutPageDto, CampaignRewardsDto, CreateManyBreakdownDto, CreateManyRewardDto, RegisterClaimsDto, TokenIdDto, } from "./reward.model";
|
9
9
|
import { RewardService } from "./reward.service";
|
10
10
|
// ─── Rewards Controller ──────────────────────────────────────────────────────
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { Campaign, Reward, RewardBreakdown } from "../../../../database/api/.generated/drizzle/schema.ts";
|
2
|
+
import { TokenService } from "../token/token.service";
|
3
|
+
import { UserService } from "../user/user.service";
|
2
4
|
import { apiDbClient } from "../../../utils/prisma";
|
3
5
|
import { and, eq, exists, inArray, sql } from "drizzle-orm";
|
4
6
|
import { CampaignService } from "../campaign";
|
5
|
-
import { TokenService } from "../token";
|
6
|
-
import { UserService } from "../user";
|
7
7
|
import { RewardService } from "./reward.service";
|
8
8
|
export class RewardRepository {
|
9
9
|
static async createManyReward(rewards) {
|
@@ -8,7 +8,7 @@ import { CampaignService } from "../campaign";
|
|
8
8
|
import { ChainService } from "../chain";
|
9
9
|
import { MerklRootService } from "../merklRoot";
|
10
10
|
import { OpportunityService } from "../opportunity";
|
11
|
-
import { TokenService } from "../token";
|
11
|
+
import { TokenService } from "../token/token.service";
|
12
12
|
import { RewardRepository } from "./reward.repository";
|
13
13
|
export class RewardService {
|
14
14
|
static hashId(root, recipient, rewardTokenId) {
|
@@ -93,20 +93,8 @@ export declare const v4: Elysia<"/v4", false, {
|
|
93
93
|
name: string;
|
94
94
|
status: "PAST" | "LIVE" | "SOON";
|
95
95
|
action: import("../../../database/api/.generated").$Enums.OpportunityAction;
|
96
|
-
tokens:
|
97
|
-
|
98
|
-
name: string | null;
|
99
|
-
id: string;
|
100
|
-
icon: string;
|
101
|
-
chainId: number;
|
102
|
-
address: string;
|
103
|
-
decimals: number;
|
104
|
-
verified: boolean;
|
105
|
-
isTest: boolean;
|
106
|
-
} & {
|
107
|
-
price?: number | null | undefined;
|
108
|
-
})[];
|
109
|
-
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
96
|
+
tokens: any[];
|
97
|
+
mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "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" | undefined;
|
110
98
|
depositUrl: any;
|
111
99
|
tags: string[];
|
112
100
|
};
|
@@ -191,19 +179,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
191
179
|
};
|
192
180
|
id: string;
|
193
181
|
depositUrl: string | undefined;
|
194
|
-
tokens:
|
195
|
-
symbol: string;
|
196
|
-
name: string | null;
|
197
|
-
id: string;
|
198
|
-
icon: string;
|
199
|
-
chainId: number;
|
200
|
-
address: string;
|
201
|
-
decimals: number;
|
202
|
-
verified: boolean;
|
203
|
-
isTest: boolean;
|
204
|
-
} & {
|
205
|
-
price?: number | null | undefined;
|
206
|
-
})[];
|
182
|
+
tokens: Token[];
|
207
183
|
chain: {
|
208
184
|
name: string;
|
209
185
|
id: number;
|
@@ -490,19 +466,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
490
466
|
id: number;
|
491
467
|
icon: string;
|
492
468
|
};
|
493
|
-
rewardToken:
|
494
|
-
symbol: string;
|
495
|
-
name: string | null;
|
496
|
-
id: string;
|
497
|
-
icon: string;
|
498
|
-
chainId: number;
|
499
|
-
address: string;
|
500
|
-
decimals: number;
|
501
|
-
verified: boolean;
|
502
|
-
isTest: boolean;
|
503
|
-
} & {
|
504
|
-
price?: number | null | undefined;
|
505
|
-
};
|
469
|
+
rewardToken: Token;
|
506
470
|
distributionChain: {
|
507
471
|
name: string;
|
508
472
|
id: number;
|
@@ -982,19 +946,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
982
946
|
id: number;
|
983
947
|
icon: string;
|
984
948
|
};
|
985
|
-
rewardToken:
|
986
|
-
symbol: string;
|
987
|
-
name: string | null;
|
988
|
-
id: string;
|
989
|
-
icon: string;
|
990
|
-
chainId: number;
|
991
|
-
address: string;
|
992
|
-
decimals: number;
|
993
|
-
verified: boolean;
|
994
|
-
isTest: boolean;
|
995
|
-
} & {
|
996
|
-
price?: number | null | undefined;
|
997
|
-
};
|
949
|
+
rewardToken: Token;
|
998
950
|
distributionChain: {
|
999
951
|
name: string;
|
1000
952
|
id: number;
|
@@ -1406,21 +1358,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1406
1358
|
};
|
1407
1359
|
headers: unknown;
|
1408
1360
|
response: {
|
1409
|
-
200:
|
1410
|
-
symbol: string;
|
1411
|
-
name: string | null;
|
1412
|
-
id: string;
|
1413
|
-
icon: string;
|
1414
|
-
chainId: number;
|
1415
|
-
address: string;
|
1416
|
-
decimals: number;
|
1417
|
-
verified: boolean;
|
1418
|
-
isTest: boolean;
|
1419
|
-
} & {
|
1420
|
-
price?: number | null | undefined;
|
1421
|
-
} & {
|
1422
|
-
balance: bigint;
|
1423
|
-
})[];
|
1361
|
+
200: any[];
|
1424
1362
|
};
|
1425
1363
|
};
|
1426
1364
|
};
|
@@ -1442,19 +1380,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1442
1380
|
};
|
1443
1381
|
headers: unknown;
|
1444
1382
|
response: {
|
1445
|
-
200:
|
1446
|
-
symbol: string;
|
1447
|
-
name: string | null;
|
1448
|
-
id: string;
|
1449
|
-
icon: string;
|
1450
|
-
chainId: number;
|
1451
|
-
address: string;
|
1452
|
-
decimals: number;
|
1453
|
-
verified: boolean;
|
1454
|
-
isTest: boolean;
|
1455
|
-
} & {
|
1456
|
-
price?: number | null | undefined;
|
1457
|
-
})[];
|
1383
|
+
200: Token[];
|
1458
1384
|
};
|
1459
1385
|
};
|
1460
1386
|
};
|
@@ -1548,6 +1474,20 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1548
1474
|
};
|
1549
1475
|
};
|
1550
1476
|
};
|
1477
|
+
} & {
|
1478
|
+
tokens: {
|
1479
|
+
sync: {
|
1480
|
+
get: {
|
1481
|
+
body: unknown;
|
1482
|
+
params: {};
|
1483
|
+
query: unknown;
|
1484
|
+
headers: unknown;
|
1485
|
+
response: {
|
1486
|
+
200: void;
|
1487
|
+
};
|
1488
|
+
};
|
1489
|
+
};
|
1490
|
+
};
|
1551
1491
|
};
|
1552
1492
|
} & {
|
1553
1493
|
v4: {
|
@@ -3297,7 +3237,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
3297
3237
|
headers: unknown;
|
3298
3238
|
response: {
|
3299
3239
|
200: (import("./claims").ClaimModel & {
|
3300
|
-
token?:
|
3240
|
+
token?: Token;
|
3301
3241
|
})[];
|
3302
3242
|
};
|
3303
3243
|
};
|
@@ -120,21 +120,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
|
|
120
120
|
};
|
121
121
|
headers: unknown;
|
122
122
|
response: {
|
123
|
-
200:
|
124
|
-
symbol: string;
|
125
|
-
name: string | null;
|
126
|
-
id: string;
|
127
|
-
icon: string;
|
128
|
-
chainId: number;
|
129
|
-
address: string;
|
130
|
-
decimals: number;
|
131
|
-
verified: boolean;
|
132
|
-
isTest: boolean;
|
133
|
-
} & {
|
134
|
-
price?: number | null | undefined;
|
135
|
-
} & {
|
136
|
-
balance: bigint;
|
137
|
-
})[];
|
123
|
+
200: any[];
|
138
124
|
};
|
139
125
|
};
|
140
126
|
};
|
@@ -156,19 +142,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
|
|
156
142
|
};
|
157
143
|
headers: unknown;
|
158
144
|
response: {
|
159
|
-
200:
|
160
|
-
symbol: string;
|
161
|
-
name: string | null;
|
162
|
-
id: string;
|
163
|
-
icon: string;
|
164
|
-
chainId: number;
|
165
|
-
address: string;
|
166
|
-
decimals: number;
|
167
|
-
verified: boolean;
|
168
|
-
isTest: boolean;
|
169
|
-
} & {
|
170
|
-
price?: number | null | undefined;
|
171
|
-
})[];
|
145
|
+
200: Token[];
|
172
146
|
};
|
173
147
|
};
|
174
148
|
};
|
@@ -262,6 +236,20 @@ export declare const TokenController: Elysia<"/tokens", false, {
|
|
262
236
|
};
|
263
237
|
};
|
264
238
|
};
|
239
|
+
} & {
|
240
|
+
tokens: {
|
241
|
+
sync: {
|
242
|
+
get: {
|
243
|
+
body: unknown;
|
244
|
+
params: {};
|
245
|
+
query: unknown;
|
246
|
+
headers: unknown;
|
247
|
+
response: {
|
248
|
+
200: void;
|
249
|
+
};
|
250
|
+
};
|
251
|
+
};
|
252
|
+
};
|
265
253
|
}, {
|
266
254
|
derive: {};
|
267
255
|
resolve: {};
|
@@ -66,4 +66,5 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
|
|
66
66
|
headers: AuthorizationHeadersDto,
|
67
67
|
beforeHandle: BackOfficeGuard,
|
68
68
|
detail: { hide: true },
|
69
|
-
})
|
69
|
+
})
|
70
|
+
.get("/sync", async () => await TokenService.fillTokenAndIconsFromTokenList(), { detail: { hide: true } });
|