@merkl/api 0.10.169 → 0.10.171
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/database/api/.generated/edge.js +6 -3
- package/dist/database/api/.generated/index-browser.js +3 -0
- package/dist/database/api/.generated/index.d.ts +113 -0
- package/dist/database/api/.generated/index.js +6 -3
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +17 -15
- package/dist/database/api/.generated/wasm.js +3 -0
- package/dist/src/eden/index.d.ts +147 -45
- package/dist/src/index.d.ts +49 -15
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/factoryFinder.js +2 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +8 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/PendleYTProcessor.d.ts +29 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/PendleYTProcessor.js +31 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/TempestVaultProcessor.d.ts +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/TempestVaultProcessor.js +36 -7
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +3 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.js +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +5 -1
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +1 -0
- package/dist/src/modules/v4/campaign/campaign.model.js +1 -0
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +2 -0
- package/dist/src/modules/v4/campaign/campaign.repository.js +3 -1
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +6 -2
- package/dist/src/modules/v4/campaign/campaign.service.js +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +27 -10
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.model.js +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +26 -4
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +2 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +50 -24
- package/dist/src/modules/v4/opportunity/opportunity.service.js +2 -1
- package/dist/src/modules/v4/price/price.controller.js +1 -1
- package/dist/src/modules/v4/price/price.service.d.ts +1 -1
- package/dist/src/modules/v4/price/price.service.js +3 -3
- package/dist/src/modules/v4/reward/reward.repository.d.ts +4 -0
- package/dist/src/modules/v4/reward/reward.service.d.ts +22 -0
- package/dist/src/modules/v4/router.d.ts +49 -15
- package/dist/src/modules/v4/token/token.controller.d.ts +9 -4
- package/dist/src/modules/v4/token/token.model.d.ts +2 -1
- package/dist/src/modules/v4/token/token.model.js +1 -0
- package/dist/src/modules/v4/token/token.repository.d.ts +13 -1
- package/dist/src/modules/v4/token/token.repository.js +2 -0
- package/dist/src/modules/v4/token/token.service.d.ts +12 -4
- package/dist/src/modules/v4/token/token.service.js +11 -2
- package/dist/src/modules/v4/user/user.controller.d.ts +8 -0
- package/dist/src/routes/v3/blacklist.d.ts +49 -15
- package/dist/src/routes/v3/campaigns.d.ts +49 -15
- package/dist/src/routes/v3/campaignsInfo.d.ts +49 -15
- package/dist/src/routes/v3/multiChainPositions.d.ts +49 -15
- package/dist/src/routes/v3/opportunity.d.ts +49 -15
- package/dist/src/routes/v3/positions.d.ts +49 -15
- package/dist/src/routes/v3/rewards.d.ts +49 -15
- package/dist/src/routes/v3/updates.d.ts +49 -15
- package/dist/src/routes/v3/userRewards.d.ts +49 -15
- package/dist/src/utils/decodeCalls.js +4 -1
- package/dist/src/utils/encodeCalls.js +4 -1
- package/dist/src/utils/generateCardName.js +2 -0
- package/dist/src/utils/prices/services/erc4626Service.js +7 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -128,14 +128,16 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
128
128
|
address: string;
|
129
129
|
icon: string;
|
130
130
|
decimals: number;
|
131
|
+
displaySymbol: string;
|
131
132
|
verified: boolean;
|
133
|
+
isTest: boolean;
|
132
134
|
price: number | null;
|
133
135
|
};
|
134
136
|
amount: bigint;
|
135
137
|
}[];
|
136
138
|
};
|
137
139
|
id: string;
|
138
|
-
tokens: {
|
140
|
+
tokens: ({
|
139
141
|
symbol: string;
|
140
142
|
name: string | null;
|
141
143
|
id: string;
|
@@ -144,8 +146,10 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
144
146
|
icon: string;
|
145
147
|
decimals: number;
|
146
148
|
verified: boolean;
|
147
|
-
|
148
|
-
}
|
149
|
+
isTest: boolean;
|
150
|
+
} & {
|
151
|
+
price?: number | null | undefined;
|
152
|
+
})[];
|
149
153
|
chain: {
|
150
154
|
name: string;
|
151
155
|
id: number;
|
@@ -227,14 +231,16 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
227
231
|
address: string;
|
228
232
|
icon: string;
|
229
233
|
decimals: number;
|
234
|
+
displaySymbol: string;
|
230
235
|
verified: boolean;
|
236
|
+
isTest: boolean;
|
231
237
|
price: number | null;
|
232
238
|
};
|
233
239
|
amount: bigint;
|
234
240
|
}[];
|
235
241
|
};
|
236
242
|
id: string;
|
237
|
-
tokens: {
|
243
|
+
tokens: ({
|
238
244
|
symbol: string;
|
239
245
|
name: string | null;
|
240
246
|
id: string;
|
@@ -243,8 +249,10 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
243
249
|
icon: string;
|
244
250
|
decimals: number;
|
245
251
|
verified: boolean;
|
246
|
-
|
247
|
-
}
|
252
|
+
isTest: boolean;
|
253
|
+
} & {
|
254
|
+
price?: number | null | undefined;
|
255
|
+
})[];
|
248
256
|
chain: {
|
249
257
|
name: string;
|
250
258
|
id: number;
|
@@ -284,7 +292,9 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
284
292
|
icon: string;
|
285
293
|
decimals: number;
|
286
294
|
verified: boolean;
|
287
|
-
|
295
|
+
isTest: boolean;
|
296
|
+
} & {
|
297
|
+
price?: number | null | undefined;
|
288
298
|
};
|
289
299
|
distributionChain: {
|
290
300
|
name: string;
|
@@ -336,6 +346,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
336
346
|
action?: string | undefined;
|
337
347
|
mainProtocolId?: string | undefined;
|
338
348
|
order?: undefined;
|
349
|
+
test?: boolean | undefined;
|
339
350
|
minimumTvl?: number | undefined;
|
340
351
|
};
|
341
352
|
headers: unknown;
|
@@ -381,14 +392,16 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
381
392
|
address: string;
|
382
393
|
icon: string;
|
383
394
|
decimals: number;
|
395
|
+
displaySymbol: string;
|
384
396
|
verified: boolean;
|
397
|
+
isTest: boolean;
|
385
398
|
price: number | null;
|
386
399
|
};
|
387
400
|
amount: bigint;
|
388
401
|
}[];
|
389
402
|
};
|
390
403
|
id: string;
|
391
|
-
tokens: {
|
404
|
+
tokens: ({
|
392
405
|
symbol: string;
|
393
406
|
name: string | null;
|
394
407
|
id: string;
|
@@ -397,8 +410,10 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
397
410
|
icon: string;
|
398
411
|
decimals: number;
|
399
412
|
verified: boolean;
|
400
|
-
|
401
|
-
}
|
413
|
+
isTest: boolean;
|
414
|
+
} & {
|
415
|
+
price?: number | null | undefined;
|
416
|
+
})[];
|
402
417
|
chain: {
|
403
418
|
name: string;
|
404
419
|
id: number;
|
@@ -445,6 +460,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
445
460
|
action?: string | undefined;
|
446
461
|
mainProtocolId?: string | undefined;
|
447
462
|
order?: undefined;
|
463
|
+
test?: boolean | undefined;
|
448
464
|
minimumTvl?: number | undefined;
|
449
465
|
};
|
450
466
|
headers: unknown;
|
@@ -475,6 +491,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
475
491
|
action?: string | undefined;
|
476
492
|
mainProtocolId?: string | undefined;
|
477
493
|
order?: undefined;
|
494
|
+
test?: boolean | undefined;
|
478
495
|
minimumTvl?: number | undefined;
|
479
496
|
};
|
480
497
|
headers: unknown;
|
@@ -549,6 +566,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
549
566
|
mainParameter?: string | undefined;
|
550
567
|
campaignId?: string | undefined;
|
551
568
|
opportunityId?: string | undefined;
|
569
|
+
test?: boolean | undefined;
|
552
570
|
tokenSymbol?: string | undefined;
|
553
571
|
};
|
554
572
|
headers: unknown;
|
@@ -569,7 +587,9 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
569
587
|
icon: string;
|
570
588
|
decimals: number;
|
571
589
|
verified: boolean;
|
572
|
-
|
590
|
+
isTest: boolean;
|
591
|
+
} & {
|
592
|
+
price?: number | null | undefined;
|
573
593
|
};
|
574
594
|
distributionChain: {
|
575
595
|
name: string;
|
@@ -617,6 +637,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
617
637
|
mainParameter?: string | undefined;
|
618
638
|
campaignId?: string | undefined;
|
619
639
|
opportunityId?: string | undefined;
|
640
|
+
test?: boolean | undefined;
|
620
641
|
tokenSymbol?: string | undefined;
|
621
642
|
};
|
622
643
|
headers: unknown;
|
@@ -772,6 +793,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
772
793
|
icon: string;
|
773
794
|
decimals: number;
|
774
795
|
verified: boolean;
|
796
|
+
isTest: boolean;
|
775
797
|
price?: number | null | undefined;
|
776
798
|
} | undefined;
|
777
799
|
};
|
@@ -801,6 +823,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
801
823
|
icon: string;
|
802
824
|
decimals: number;
|
803
825
|
verified: boolean;
|
826
|
+
isTest: boolean;
|
804
827
|
} & {
|
805
828
|
price?: number | null | undefined;
|
806
829
|
} & {
|
@@ -822,10 +845,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
822
845
|
chainId?: any;
|
823
846
|
address?: string | undefined;
|
824
847
|
verified?: boolean | undefined;
|
848
|
+
test?: boolean | undefined;
|
825
849
|
};
|
826
850
|
headers: unknown;
|
827
851
|
response: {
|
828
|
-
200:
|
852
|
+
200: {
|
829
853
|
symbol: string;
|
830
854
|
name: string | null;
|
831
855
|
id: string;
|
@@ -833,10 +857,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
833
857
|
address: string;
|
834
858
|
icon: string;
|
835
859
|
decimals: number;
|
860
|
+
displaySymbol: string;
|
836
861
|
verified: boolean;
|
837
|
-
|
838
|
-
price
|
839
|
-
}
|
862
|
+
isTest: boolean;
|
863
|
+
price: number | null;
|
864
|
+
}[];
|
840
865
|
};
|
841
866
|
};
|
842
867
|
};
|
@@ -853,6 +878,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
853
878
|
chainId?: any;
|
854
879
|
address?: string | undefined;
|
855
880
|
verified?: boolean | undefined;
|
881
|
+
test?: boolean | undefined;
|
856
882
|
};
|
857
883
|
headers: unknown;
|
858
884
|
response: {
|
@@ -1496,7 +1522,9 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
1496
1522
|
address: string;
|
1497
1523
|
icon: string;
|
1498
1524
|
decimals: number;
|
1525
|
+
displaySymbol: string;
|
1499
1526
|
verified: boolean;
|
1527
|
+
isTest: boolean;
|
1500
1528
|
price: number | null;
|
1501
1529
|
};
|
1502
1530
|
breakdowns: {
|
@@ -1515,7 +1543,9 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
1515
1543
|
address: string;
|
1516
1544
|
icon: string;
|
1517
1545
|
decimals: number;
|
1546
|
+
displaySymbol: string;
|
1518
1547
|
verified: boolean;
|
1548
|
+
isTest: boolean;
|
1519
1549
|
price: number | null;
|
1520
1550
|
}[];
|
1521
1551
|
Protocols: {
|
@@ -1606,7 +1636,9 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
1606
1636
|
address: string;
|
1607
1637
|
icon: string;
|
1608
1638
|
decimals: number;
|
1639
|
+
displaySymbol: string;
|
1609
1640
|
verified: boolean;
|
1641
|
+
isTest: boolean;
|
1610
1642
|
price: number | null;
|
1611
1643
|
};
|
1612
1644
|
breakdowns: {
|
@@ -1625,7 +1657,9 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
|
|
1625
1657
|
address: string;
|
1626
1658
|
icon: string;
|
1627
1659
|
decimals: number;
|
1660
|
+
displaySymbol: string;
|
1628
1661
|
verified: boolean;
|
1662
|
+
isTest: boolean;
|
1629
1663
|
price: number | null;
|
1630
1664
|
}[];
|
1631
1665
|
Protocols: {
|
@@ -1,8 +1,10 @@
|
|
1
|
-
import { AaveInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CompoundInterface, CurveInterface, ERC20Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, RadiantInterface, RfxInterface, SturdyInterface, SymetricAmbientStrategyInterface, TorosInterface, UniswapV2PoolInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
|
1
|
+
import { AaveInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CompoundInterface, CurveInterface, ERC20Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, SturdyInterface, SymetricAmbientStrategyInterface, TorosInterface, UniswapV2PoolInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
|
2
2
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
3
3
|
export function decodeCall(calls, index, key, type) {
|
4
4
|
const returnData = calls[index];
|
5
5
|
switch (key) {
|
6
|
+
case "SY":
|
7
|
+
return PendleYTInterface.decodeFunctionResult("SY", returnData)[0];
|
6
8
|
case "symbol":
|
7
9
|
return ERC20Interface.decodeFunctionResult("symbol", returnData)[0];
|
8
10
|
case "decimals":
|
@@ -44,6 +46,7 @@ export function decodeCall(calls, index, key, type) {
|
|
44
46
|
case "underlying":
|
45
47
|
switch (type) {
|
46
48
|
case tokenType.pendle:
|
49
|
+
case tokenType.pendleYT:
|
47
50
|
return PendleInterface.decodeFunctionResult("yieldToken", returnData)[0];
|
48
51
|
case tokenType.gearbox:
|
49
52
|
return GearboxVaultInterface.decodeFunctionResult("underlyingToken", returnData)[0];
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
2
|
-
import { AaveInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CompoundInterface, CurveInterface, ERC20Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, RadiantInterface, RfxDatastoreInterface, SturdyInterface, SymetricAmbientStrategyInterface, TorosInterface, UniswapV2PoolInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
|
2
|
+
import { AaveInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CompoundInterface, CurveInterface, ERC20Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, SturdyInterface, SymetricAmbientStrategyInterface, TorosInterface, UniswapV2PoolInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
|
3
3
|
import { fluidInterface } from "src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1";
|
4
4
|
export function createCall(target, key, type, metaData) {
|
5
5
|
switch (key) {
|
6
|
+
case "SY":
|
7
|
+
return { allowFailure: true, callData: PendleYTInterface.encodeFunctionData("SY"), target };
|
6
8
|
case "collateralContract":
|
7
9
|
return { allowFailure: true, callData: SturdyInterface.encodeFunctionData("collateralContract"), target };
|
8
10
|
case "pricePerShare":
|
@@ -63,6 +65,7 @@ export function createCall(target, key, type, metaData) {
|
|
63
65
|
case "underlying":
|
64
66
|
switch (type) {
|
65
67
|
case tokenType.pendle:
|
68
|
+
case tokenType.pendleYT:
|
66
69
|
return { allowFailure: true, callData: PendleInterface.encodeFunctionData("yieldToken"), target };
|
67
70
|
case tokenType.metamorpho:
|
68
71
|
return { allowFailure: true, callData: MetamorphoInterface.encodeFunctionData("asset"), target };
|
@@ -14,6 +14,8 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""]) {
|
|
14
14
|
case tokenType.ra:
|
15
15
|
case tokenType.syncswap:
|
16
16
|
return `${typeInfo.protocol} ${typeInfo.symbolToken0}/${typeInfo.symbolToken1}`;
|
17
|
+
case tokenType.pendleYT:
|
18
|
+
return `Hold YT of ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
|
17
19
|
case tokenType.pendle:
|
18
20
|
return `Provide ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
|
19
21
|
case tokenType.balancerGauge:
|
@@ -25,6 +25,12 @@ export default class ERC4626Service {
|
|
25
25
|
return resolvedPrices.flat().filter(price => price !== undefined);
|
26
26
|
}
|
27
27
|
async priceCalculation(rate, vaultToken) {
|
28
|
-
|
28
|
+
try {
|
29
|
+
const vaultTokenPrice = await PriceService.fetchPriceBySymbol(vaultToken);
|
30
|
+
return rate * vaultTokenPrice;
|
31
|
+
}
|
32
|
+
catch {
|
33
|
+
return Number.NaN;
|
34
|
+
}
|
29
35
|
}
|
30
36
|
}
|