@merkl/api 0.20.63 → 0.20.65
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/database/index.js +5 -1
- package/dist/src/eden/index.d.ts +115 -214
- package/dist/src/engine/dynamicData/implementations/Erc20.js +80 -42
- package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.d.ts +18 -18
- package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.js +33 -30
- package/dist/src/engine/erc20SubTypeProcessors/{helpers/tokenType.d.ts → constants.d.ts} +0 -6
- package/dist/src/engine/erc20SubTypeProcessors/factory.d.ts +6 -0
- package/dist/src/engine/erc20SubTypeProcessors/{implementations/processorMapping.js → factory.js} +49 -48
- package/dist/src/engine/erc20SubTypeProcessors/helpers/factoryFinder.d.ts +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/factoryFinder.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/hardcoded.d.ts +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/hardcoded.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.d.ts +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.js +1 -5
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.js +6 -7
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +4 -5
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.js +3 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.js +3 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BeefyProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BeefyProcessor.js +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BunniV2Processor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BunniV2Processor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/CompoundProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/CompoundProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FluidProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FluidProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.js +1 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.js +4 -5
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HourglassProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HourglassProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MetamorphoProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MetamorphoProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.js +3 -6
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RadiantProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RadiantProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.js +5 -6
- package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.js +0 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TemplateProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TemplateProcessor.js +0 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.js +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.js +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.js +7 -7
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.js +5 -6
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.js +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.js +3 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.js +3 -4
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.d.ts +17 -3
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +52 -62
- package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.js +1 -1
- package/dist/src/index.d.ts +23 -50
- package/dist/src/jobs/update-dynamic-data.js +10 -12
- package/dist/src/jobs/update-rpc-calls-cache.js +9 -4
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +23 -50
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -9
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +0 -11
- package/dist/src/modules/v4/opportunity/opportunity.model.js +0 -5
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +25 -14
- package/dist/src/modules/v4/opportunity/opportunity.service.js +2 -1
- package/dist/src/modules/v4/router.d.ts +23 -50
- package/dist/src/utils/decodeCalls.d.ts +1 -1
- package/dist/src/utils/decodeCalls.js +1 -1
- package/dist/src/utils/encodeCalls.d.ts +2 -2
- package/dist/src/utils/encodeCalls.js +15 -15
- package/dist/src/utils/generateCardName.d.ts +4 -3
- package/dist/src/utils/generateCardName.js +3 -3
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.d.ts +0 -6
- package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.d.ts +0 -4
- package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.js +0 -24
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.d.ts +0 -4
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.js +0 -22
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.d.ts +0 -3
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.js +0 -22
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.d.ts +0 -3
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.js +0 -22
- package/dist/src/utils/generateIcons.d.ts +0 -3
- package/dist/src/utils/generateIcons.js +0 -65
- /package/dist/src/engine/erc20SubTypeProcessors/{helpers/tokenType.js → constants.js} +0 -0
@@ -1,7 +1,8 @@
|
|
1
1
|
import type { Pricer } from "@/utils/pricer";
|
2
|
-
import { type CallDto, type
|
2
|
+
import { type CallDto, type CampaignParameters } from "@sdk";
|
3
3
|
import type { ERC20SupportedCampaignType } from "../dynamicData/implementations/Erc20";
|
4
|
-
import { type tokenType
|
4
|
+
import { type tokenType } from "./constants";
|
5
|
+
import type { tokenTypeStruct } from "./interface";
|
5
6
|
export declare enum Round {
|
6
7
|
one = "round1",
|
7
8
|
two = "round2",
|
@@ -9,14 +10,13 @@ export declare enum Round {
|
|
9
10
|
four = "round4"
|
10
11
|
}
|
11
12
|
export type callType = {
|
12
|
-
key:
|
13
|
-
call:
|
14
|
-
target:
|
15
|
-
|
13
|
+
key: string;
|
14
|
+
call: string;
|
15
|
+
target: string;
|
16
|
+
callArgs?: string;
|
16
17
|
optional?: boolean;
|
17
18
|
};
|
18
19
|
export type mandatoryCallKeys = {
|
19
|
-
type: tokenType;
|
20
20
|
protocol: string;
|
21
21
|
tokenAddress: string;
|
22
22
|
blacklistedSupply: string;
|
@@ -28,11 +28,8 @@ export type stakingKeys = {
|
|
28
28
|
eip712DomainName: string;
|
29
29
|
stakingName: string;
|
30
30
|
stakingSymbol: string;
|
31
|
-
isStaking: string;
|
32
|
-
};
|
33
|
-
export type callKeys = mandatoryCallKeys & {
|
34
|
-
[key: string]: string;
|
35
31
|
};
|
32
|
+
export type callKeys = mandatoryCallKeys & Record<string, string>;
|
36
33
|
export type dataRaw = {
|
37
34
|
protocol: string;
|
38
35
|
tokenAddress: string;
|
@@ -42,7 +39,6 @@ export type dataRaw = {
|
|
42
39
|
} & stakingKeys;
|
43
40
|
export type dataType = {
|
44
41
|
protocol: string;
|
45
|
-
type: tokenType;
|
46
42
|
tokenAddress: string;
|
47
43
|
totalSupply: number;
|
48
44
|
blacklistedSupply: number;
|
@@ -63,6 +59,11 @@ export type dataType = {
|
|
63
59
|
* @params Output - Final output of the processor
|
64
60
|
*/
|
65
61
|
export declare class GenericProcessor<Input extends callKeys, DataRaw extends dataRaw, Output extends dataType> {
|
62
|
+
debug: boolean;
|
63
|
+
type: tokenType;
|
64
|
+
isStaking: boolean;
|
65
|
+
campaign: CampaignParameters<ERC20SupportedCampaignType>;
|
66
|
+
constructor(type: tokenType, campaign: CampaignParameters<ERC20SupportedCampaignType>, debug?: boolean);
|
66
67
|
rounds: {
|
67
68
|
round1: callType[];
|
68
69
|
round2: callType[];
|
@@ -75,24 +76,23 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
75
76
|
round3: callType[];
|
76
77
|
round4: callType[];
|
77
78
|
};
|
78
|
-
debug: boolean;
|
79
79
|
processingRound1(_typeInfo: DataRaw): void;
|
80
80
|
processingRound2(_typeInfo: DataRaw, _campaign?: CampaignParameters<ERC20SupportedCampaignType>): void;
|
81
81
|
processingRound3(_typeInfo: DataRaw): void;
|
82
82
|
processingRound4(_typeInfo: DataRaw): void;
|
83
|
-
handleWhiteListBlacklistRound5(typeInfo: DataRaw, campaign: CampaignParameters<
|
83
|
+
handleWhiteListBlacklistRound5(typeInfo: DataRaw, campaign: CampaignParameters<ERC20SupportedCampaignType>): {
|
84
84
|
whitelistedSupplyTargetToken: any;
|
85
85
|
totalSupply: any;
|
86
86
|
blacklistedSupply: any;
|
87
87
|
};
|
88
|
-
processingRound5(_index: number, type: tokenType, typeInfo: DataRaw, _calls: string[], campaign: CampaignParameters<
|
89
|
-
computeRound1(
|
88
|
+
processingRound5(_index: number, type: tokenType, typeInfo: DataRaw, _calls: string[], campaign: CampaignParameters<ERC20SupportedCampaignType>, pricer: Pricer): Promise<Output>;
|
89
|
+
computeRound1(typeInfo: DataRaw): tokenTypeStruct;
|
90
90
|
computeRound2(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign?: CampaignParameters<ERC20SupportedCampaignType>): tokenTypeStruct;
|
91
91
|
computeRound3(index: number, type: tokenType, typeInfo: DataRaw, calls: string[]): tokenTypeStruct;
|
92
92
|
computeRound4(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<ERC20SupportedCampaignType>): tokenTypeStruct;
|
93
93
|
computeRound5(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<ERC20SupportedCampaignType>, pricer: Pricer): Promise<tokenTypeStruct>;
|
94
|
-
generateWhitelistCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<
|
95
|
-
generateBlackListCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<
|
94
|
+
generateWhitelistCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<ERC20SupportedCampaignType>): CallDto[];
|
95
|
+
generateBlackListCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<ERC20SupportedCampaignType>): CallDto[];
|
96
96
|
decodeListedSupply(index: number, list: string[], calls: string[]): string;
|
97
97
|
decodeRound(round: callType[], index: number, calls: string[], type: tokenType, data: DataRaw): void;
|
98
98
|
decodePreviousRound(round: Round, calls: string[], data: DataRaw, type: tokenType, index: number): void;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { decodeCall } from "@/utils/decodeCalls";
|
2
2
|
import { createCall } from "@/utils/encodeCalls";
|
3
3
|
import { generateCardName } from "@/utils/generateCardName";
|
4
|
-
import { generateIcons } from "@/utils/generateIcons";
|
5
4
|
import { BN2Number } from "@sdk";
|
6
|
-
import { tokenTypeToProtocolAndAction } from "./
|
5
|
+
import { tokenTypeToProtocolAndAction } from "./constants";
|
6
|
+
import { parseForStaking } from "./subtypesRound1";
|
7
7
|
export var Round;
|
8
8
|
(function (Round) {
|
9
9
|
Round["one"] = "round1";
|
@@ -19,6 +19,16 @@ export var Round;
|
|
19
19
|
* @params Output - Final output of the processor
|
20
20
|
*/
|
21
21
|
export class GenericProcessor {
|
22
|
+
debug; // Wheter to log have additional logs
|
23
|
+
type; // Type of the ERC20 we're processing
|
24
|
+
isStaking; // Whether this campaign is in fact targeting a staking contract of the target ERC20
|
25
|
+
campaign; // Campaign parameters
|
26
|
+
constructor(type, campaign, debug = false) {
|
27
|
+
this.debug = debug;
|
28
|
+
this.type = type;
|
29
|
+
this.campaign = campaign;
|
30
|
+
this.isStaking = parseForStaking(campaign).isStaking;
|
31
|
+
}
|
22
32
|
rounds = {
|
23
33
|
round1: [],
|
24
34
|
round2: [],
|
@@ -36,7 +46,6 @@ export class GenericProcessor {
|
|
36
46
|
round3: [],
|
37
47
|
round4: [],
|
38
48
|
};
|
39
|
-
debug = false;
|
40
49
|
processingRound1(_typeInfo) { }
|
41
50
|
processingRound2(_typeInfo, _campaign) { }
|
42
51
|
processingRound3(_typeInfo) { }
|
@@ -69,38 +78,38 @@ export class GenericProcessor {
|
|
69
78
|
priceTargetToken,
|
70
79
|
tvl,
|
71
80
|
blacklistedSupply,
|
72
|
-
cardName: generateCardName(type, typeInfo, campaign),
|
81
|
+
cardName: generateCardName(type, this.isStaking, typeInfo, campaign),
|
73
82
|
tokensDisplay: [{ symbol: campaign.campaignParameters.symbolTargetToken, address: typeInfo.tokenAddress }],
|
74
83
|
};
|
75
84
|
}
|
76
|
-
computeRound1(
|
77
|
-
typeInfo = { type, ...tokenTypeToProtocolAndAction[type], ...typeInfo };
|
85
|
+
computeRound1(typeInfo) {
|
86
|
+
typeInfo = { type: this.type, ...tokenTypeToProtocolAndAction[this.type], ...typeInfo };
|
78
87
|
this.processingRound1(typeInfo);
|
79
|
-
let calls = this.encodeNextRound(Round.one, type, typeInfo);
|
80
|
-
if (
|
81
|
-
calls = calls.concat(this.encodeStakingNextRound(Round.one, type, typeInfo));
|
88
|
+
let calls = this.encodeNextRound(Round.one, this.type, typeInfo);
|
89
|
+
if (this.isStaking) {
|
90
|
+
calls = calls.concat(this.encodeStakingNextRound(Round.one, this.type, typeInfo));
|
82
91
|
}
|
83
92
|
if (this.debug) {
|
84
93
|
console.log("Round 1", {
|
85
|
-
type: type,
|
94
|
+
type: this.type,
|
86
95
|
calls,
|
87
96
|
typeInfo,
|
88
97
|
});
|
89
98
|
}
|
90
99
|
return {
|
91
|
-
type: type,
|
100
|
+
type: this.type,
|
92
101
|
calls,
|
93
102
|
typeInfo,
|
94
103
|
};
|
95
104
|
}
|
96
105
|
computeRound2(index, type, typeInfo, calls, campaign) {
|
97
106
|
this.decodePreviousRound(Round.one, calls, typeInfo, type, index);
|
98
|
-
if (
|
107
|
+
if (this.isStaking) {
|
99
108
|
this.decodePreviousStakingRound(Round.one, calls, typeInfo, type, index + this.rounds.round1.length);
|
100
109
|
}
|
101
110
|
this.processingRound2(typeInfo, campaign);
|
102
111
|
let nextCalls = this.encodeNextRound(Round.two, type, typeInfo);
|
103
|
-
if (
|
112
|
+
if (this.isStaking) {
|
104
113
|
nextCalls = nextCalls.concat(this.encodeStakingNextRound(Round.two, type, typeInfo));
|
105
114
|
}
|
106
115
|
if (this.debug) {
|
@@ -118,12 +127,12 @@ export class GenericProcessor {
|
|
118
127
|
}
|
119
128
|
computeRound3(index, type, typeInfo, calls) {
|
120
129
|
this.decodePreviousRound(Round.two, calls, typeInfo, type, index);
|
121
|
-
if (
|
130
|
+
if (this.isStaking) {
|
122
131
|
this.decodePreviousStakingRound(Round.two, calls, typeInfo, type, index + this.rounds.round2.length);
|
123
132
|
}
|
124
133
|
this.processingRound3(typeInfo);
|
125
134
|
let nextCalls = this.encodeNextRound(Round.three, type, typeInfo);
|
126
|
-
if (
|
135
|
+
if (this.isStaking) {
|
127
136
|
nextCalls = nextCalls.concat(this.encodeStakingNextRound(Round.three, type, typeInfo));
|
128
137
|
}
|
129
138
|
if (this.debug) {
|
@@ -143,12 +152,12 @@ export class GenericProcessor {
|
|
143
152
|
const blacklistedLiquidityCalls = this.generateBlackListCall(type, typeInfo, campaign);
|
144
153
|
const whitelistedLiquidityCalls = this.generateWhitelistCall(type, typeInfo, campaign);
|
145
154
|
this.decodePreviousRound(Round.three, calls, typeInfo, type, index);
|
146
|
-
if (
|
155
|
+
if (this.isStaking) {
|
147
156
|
this.decodePreviousStakingRound(Round.three, calls, typeInfo, type, index + this.rounds.round3.length);
|
148
157
|
}
|
149
158
|
this.processingRound4(typeInfo);
|
150
159
|
let nextCalls = this.encodeNextRound(Round.four, type, typeInfo);
|
151
|
-
if (
|
160
|
+
if (this.isStaking) {
|
152
161
|
nextCalls = nextCalls.concat(this.encodeStakingNextRound(Round.four, type, typeInfo));
|
153
162
|
}
|
154
163
|
if (this.debug) {
|
@@ -172,7 +181,7 @@ export class GenericProcessor {
|
|
172
181
|
typeInfo.blacklistedSupply = this.decodeListedSupply(index, campaign.campaignParameters.blacklist, calls);
|
173
182
|
index = index + campaign.campaignParameters.blacklist.length;
|
174
183
|
this.decodePreviousRound(Round.four, calls, typeInfo, type, index);
|
175
|
-
if (
|
184
|
+
if (this.isStaking) {
|
176
185
|
this.decodePreviousStakingRound(Round.four, calls, typeInfo, type, index + this.rounds.round4.length);
|
177
186
|
}
|
178
187
|
const outputInfo = (await this.processingRound5(index, type, typeInfo, calls, campaign, pricer));
|
@@ -180,19 +189,13 @@ export class GenericProcessor {
|
|
180
189
|
console.log("Round 5", {
|
181
190
|
type: type,
|
182
191
|
calls: [],
|
183
|
-
typeInfo:
|
184
|
-
...outputInfo,
|
185
|
-
icons: generateIcons(type, typeInfo, campaign),
|
186
|
-
},
|
192
|
+
typeInfo: outputInfo,
|
187
193
|
});
|
188
194
|
}
|
189
195
|
return {
|
190
196
|
type: type,
|
191
197
|
calls: [],
|
192
|
-
typeInfo:
|
193
|
-
...outputInfo,
|
194
|
-
icons: generateIcons(type, typeInfo, campaign),
|
195
|
-
},
|
198
|
+
typeInfo: outputInfo,
|
196
199
|
};
|
197
200
|
}
|
198
201
|
generateWhitelistCall(type, typeInfo, campaign) {
|
@@ -274,12 +277,12 @@ export class GenericProcessor {
|
|
274
277
|
}
|
275
278
|
encodeRound(round, callInfo, type) {
|
276
279
|
return round
|
277
|
-
.map(({ call, target,
|
278
|
-
if (optional && !callInfo[target]) {
|
280
|
+
.map(({ call, target, callArgs, optional }) => {
|
281
|
+
if (!optional && !callInfo[target]) {
|
279
282
|
return [];
|
280
283
|
}
|
281
|
-
if (
|
282
|
-
return createCall(callInfo[target], call, type, callInfo[
|
284
|
+
if (callArgs) {
|
285
|
+
return createCall(callInfo[target], call, type, callInfo[callArgs]);
|
283
286
|
}
|
284
287
|
return createCall(callInfo[target], call, type);
|
285
288
|
})
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { ProtocolId } from "@/modules/v4/protocol/protocol.model";
|
2
2
|
import { OpportunityAction } from "@db/api";
|
3
|
-
import type { CallDto } from "@sdk";
|
4
3
|
export declare enum tokenType {
|
5
4
|
aura = "aura",
|
6
5
|
anglesLiquid = "anglesLiquid",
|
@@ -103,8 +102,3 @@ export declare const tokenTypeToProtocolAndAction: Record<tokenType, {
|
|
103
102
|
protocol: ProtocolId | undefined;
|
104
103
|
action: OpportunityAction;
|
105
104
|
}>;
|
106
|
-
export type tokenTypeStruct = {
|
107
|
-
type: tokenType;
|
108
|
-
calls: CallDto[];
|
109
|
-
typeInfo: any;
|
110
|
-
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { CampaignParameters } from "@sdk";
|
2
|
+
import type { ERC20SupportedCampaignType } from "../dynamicData/implementations/Erc20";
|
3
|
+
import { GenericProcessor } from "./GenericProcessor";
|
4
|
+
import type { callKeys, dataRaw, dataType } from "./GenericProcessor";
|
5
|
+
import { tokenType } from "./constants";
|
6
|
+
export declare const erc20ProcessorFactory: (type: tokenType, campaign: CampaignParameters<ERC20SupportedCampaignType>, debug?: boolean) => GenericProcessor<callKeys, dataRaw, dataType>;
|
package/dist/src/engine/erc20SubTypeProcessors/{implementations/processorMapping.js → factory.js}
RENAMED
@@ -1,51 +1,51 @@
|
|
1
|
-
import { GenericProcessor } from "
|
2
|
-
import { tokenType } from "
|
3
|
-
import { AaveProcessor } from "./AaveProcessor";
|
4
|
-
import { AnglesLiquidProcessor } from "./AnglesLiquid";
|
5
|
-
import { AssetProcessor } from "./AssetProcessor";
|
6
|
-
import { AuraProcessor } from "./AuraProcessor";
|
7
|
-
import { BEXRewardGaugeProcessor } from "./BEXRewardGaugeProcessor";
|
8
|
-
import { BalancerGaugeProcessor } from "./BalancerGaugeProcessor";
|
9
|
-
import { BalancerPoolProcessor } from "./BalancerPoolProcessor";
|
10
|
-
import { BalancerV3PoolProcessor } from "./BalancerV3PoolProcessor";
|
11
|
-
import { BeefyProcessor } from "./BeefyProcessor";
|
12
|
-
import { BunniV2Processor } from "./BunniV2Processor";
|
13
|
-
import { CompoundProcessor } from "./CompoundProcessor";
|
14
|
-
import { ERC4626Processor } from "./ERC4626Processor";
|
15
|
-
import { EnzymeProcessor } from "./EnzymeProcessor";
|
16
|
-
import { EqualizerGaugeProcessor } from "./EqualizerGaugeProcessor";
|
17
|
-
import { EulerBorrowProcessor } from "./EulerBorrowProcessor";
|
18
|
-
import { EulerLendProcessor } from "./EulerLendProcessor";
|
19
|
-
import { FluidProcessor } from "./FluidProcessor";
|
20
|
-
import { FraxProcessor } from "./FraxProcessor";
|
21
|
-
import { GammaProcessor } from "./GammaProcessor";
|
22
|
-
import { GearboxProcessor } from "./GearboxProcessor";
|
23
|
-
import { HanjiVaultProcessor } from "./HanjiVaultProcessor";
|
24
|
-
import { HoldStationProcessor } from "./HoldStationProcessor";
|
25
|
-
import { HourglassProcessor } from "./HourglassProcessor";
|
26
|
-
import { MaverickBPProcessor } from "./MaverickBPProcessor";
|
27
|
-
import { MetamorphoProcessor } from "./MetamorphoProcessor";
|
28
|
-
import { NoLinkVaultProcessor } from "./NoLinkVaultProcessor";
|
29
|
-
import { PendleProcessor } from "./PendleProcessor";
|
30
|
-
import { PendleYTProcessor } from "./PendleYTProcessor";
|
31
|
-
import { RadiantProcessor } from "./RadiantProcessor";
|
32
|
-
import { RfxProcessor } from "./RfxProcessor";
|
33
|
-
import { SatlayerProcessor } from "./Satlayer";
|
34
|
-
import { SpectraProcessor } from "./SpectraProcessor";
|
35
|
-
import { SpectraYTProcessor } from "./SpectraYTProcessor";
|
36
|
-
import { SpliceProcessor } from "./SpliceProcessor";
|
37
|
-
import { SturdySiloProcessor } from "./SturdySiloProcessor";
|
38
|
-
import { TempestVaultProcessor } from "./TempestVaultProcessor";
|
39
|
-
import { TorosProcessor } from "./TorosProcessor";
|
40
|
-
import { UniswapProcessor } from "./UniswapProcessor";
|
41
|
-
import { VicunaProcessor } from "./VicunaProcessor";
|
42
|
-
import { WoofiProcessor } from "./WoofiProcessor";
|
43
|
-
import { ZkSwapThreePoolProcessor } from "./ZkSwapThreePoolProcessor";
|
44
|
-
import { CurveNPoolProcessor } from "./curveNPoolProcessor";
|
45
|
-
import { CurveProcessor } from "./curveProcessor";
|
46
|
-
import { StakedCurveProcessor } from "./stakedCurveProcessor";
|
47
|
-
import { xU308Processor } from "./xU308Processor";
|
48
|
-
|
1
|
+
import { GenericProcessor } from "./GenericProcessor";
|
2
|
+
import { tokenType } from "./constants";
|
3
|
+
import { AaveProcessor } from "./implementations/AaveProcessor";
|
4
|
+
import { AnglesLiquidProcessor } from "./implementations/AnglesLiquid";
|
5
|
+
import { AssetProcessor } from "./implementations/AssetProcessor";
|
6
|
+
import { AuraProcessor } from "./implementations/AuraProcessor";
|
7
|
+
import { BEXRewardGaugeProcessor } from "./implementations/BEXRewardGaugeProcessor";
|
8
|
+
import { BalancerGaugeProcessor } from "./implementations/BalancerGaugeProcessor";
|
9
|
+
import { BalancerPoolProcessor } from "./implementations/BalancerPoolProcessor";
|
10
|
+
import { BalancerV3PoolProcessor } from "./implementations/BalancerV3PoolProcessor";
|
11
|
+
import { BeefyProcessor } from "./implementations/BeefyProcessor";
|
12
|
+
import { BunniV2Processor } from "./implementations/BunniV2Processor";
|
13
|
+
import { CompoundProcessor } from "./implementations/CompoundProcessor";
|
14
|
+
import { ERC4626Processor } from "./implementations/ERC4626Processor";
|
15
|
+
import { EnzymeProcessor } from "./implementations/EnzymeProcessor";
|
16
|
+
import { EqualizerGaugeProcessor } from "./implementations/EqualizerGaugeProcessor";
|
17
|
+
import { EulerBorrowProcessor } from "./implementations/EulerBorrowProcessor";
|
18
|
+
import { EulerLendProcessor } from "./implementations/EulerLendProcessor";
|
19
|
+
import { FluidProcessor } from "./implementations/FluidProcessor";
|
20
|
+
import { FraxProcessor } from "./implementations/FraxProcessor";
|
21
|
+
import { GammaProcessor } from "./implementations/GammaProcessor";
|
22
|
+
import { GearboxProcessor } from "./implementations/GearboxProcessor";
|
23
|
+
import { HanjiVaultProcessor } from "./implementations/HanjiVaultProcessor";
|
24
|
+
import { HoldStationProcessor } from "./implementations/HoldStationProcessor";
|
25
|
+
import { HourglassProcessor } from "./implementations/HourglassProcessor";
|
26
|
+
import { MaverickBPProcessor } from "./implementations/MaverickBPProcessor";
|
27
|
+
import { MetamorphoProcessor } from "./implementations/MetamorphoProcessor";
|
28
|
+
import { NoLinkVaultProcessor } from "./implementations/NoLinkVaultProcessor";
|
29
|
+
import { PendleProcessor } from "./implementations/PendleProcessor";
|
30
|
+
import { PendleYTProcessor } from "./implementations/PendleYTProcessor";
|
31
|
+
import { RadiantProcessor } from "./implementations/RadiantProcessor";
|
32
|
+
import { RfxProcessor } from "./implementations/RfxProcessor";
|
33
|
+
import { SatlayerProcessor } from "./implementations/Satlayer";
|
34
|
+
import { SpectraProcessor } from "./implementations/SpectraProcessor";
|
35
|
+
import { SpectraYTProcessor } from "./implementations/SpectraYTProcessor";
|
36
|
+
import { SpliceProcessor } from "./implementations/SpliceProcessor";
|
37
|
+
import { SturdySiloProcessor } from "./implementations/SturdySiloProcessor";
|
38
|
+
import { TempestVaultProcessor } from "./implementations/TempestVaultProcessor";
|
39
|
+
import { TorosProcessor } from "./implementations/TorosProcessor";
|
40
|
+
import { UniswapProcessor } from "./implementations/UniswapProcessor";
|
41
|
+
import { VicunaProcessor } from "./implementations/VicunaProcessor";
|
42
|
+
import { WoofiProcessor } from "./implementations/WoofiProcessor";
|
43
|
+
import { ZkSwapThreePoolProcessor } from "./implementations/ZkSwapThreePoolProcessor";
|
44
|
+
import { CurveNPoolProcessor } from "./implementations/curveNPoolProcessor";
|
45
|
+
import { CurveProcessor } from "./implementations/curveProcessor";
|
46
|
+
import { StakedCurveProcessor } from "./implementations/stakedCurveProcessor";
|
47
|
+
import { xU308Processor } from "./implementations/xU308Processor";
|
48
|
+
const map = {
|
49
49
|
[tokenType.uniswapv2]: UniswapProcessor,
|
50
50
|
[tokenType.balancerGauge]: BalancerGaugeProcessor,
|
51
51
|
[tokenType.balancerPool]: BalancerPoolProcessor,
|
@@ -143,3 +143,4 @@ export const processorMapping = {
|
|
143
143
|
[tokenType.xlend_lending]: AaveProcessor,
|
144
144
|
[tokenType.curve_gauge]: StakedCurveProcessor,
|
145
145
|
};
|
146
|
+
export const erc20ProcessorFactory = (type, campaign, debug = false) => new map[type](type, campaign, debug);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { tokenType } from "
|
1
|
+
import { tokenType } from "../constants";
|
2
2
|
const factoryAddresses = {
|
3
3
|
"0x420DD381b31aEf6683db6B902084cB0FFECe40Da": tokenType.aerodrome, // Aerodrome Base Factory
|
4
4
|
"0x31832f2a97Fd20664D76Cc421207669b55CE4BC0": tokenType.velodrome, // Velodrome Mode Factory
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { tokenType } from "
|
1
|
+
import { tokenType } from "../constants";
|
2
2
|
export declare function getTypeFromOwnerAddress(address: string): tokenType;
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import type { Pricer } from "@/utils/pricer";
|
2
2
|
import type { Campaign, CampaignParameters } from "@sdk";
|
3
3
|
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "../GenericProcessor";
|
4
|
-
import type { tokenType } from "../
|
4
|
+
import type { tokenType } from "../constants";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawAave;
|
7
7
|
call: string;
|
8
8
|
target: keyof callKeysAave;
|
9
|
-
metaData?: keyof callKeysAave;
|
10
9
|
};
|
11
10
|
export type callKeysAave = mandatoryCallKeys & {
|
12
11
|
underlying: string;
|
@@ -7,7 +7,6 @@ export class AaveProcessor extends GenericProcessor {
|
|
7
7
|
round3: [],
|
8
8
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
9
9
|
};
|
10
|
-
// // override computeRound1(): void {}
|
11
10
|
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
12
11
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
13
12
|
const priceTargetToken = (await pricer.get({ symbol: typeInfo.symbolUnderlyingToken })) ?? 0;
|
@@ -17,7 +16,7 @@ export class AaveProcessor extends GenericProcessor {
|
|
17
16
|
whitelistedSupplyTargetToken,
|
18
17
|
tvl: tvl,
|
19
18
|
priceTargetToken,
|
20
|
-
cardName: generateCardName(type, typeInfo, campaign),
|
19
|
+
cardName: generateCardName(type, this.isStaking, typeInfo, campaign),
|
21
20
|
blacklistedSupply,
|
22
21
|
totalSupply,
|
23
22
|
tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import type { Pricer } from "@/utils/pricer";
|
2
2
|
import { type Campaign, type CampaignParameters } from "@sdk";
|
3
3
|
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "../GenericProcessor";
|
4
|
-
import type { tokenType
|
4
|
+
import type { tokenType } from "../constants";
|
5
|
+
import type { tokenTypeStruct } from "../interface";
|
5
6
|
type callType = {
|
6
7
|
key: keyof dataRawAnglesLiquid;
|
7
8
|
call: string;
|
8
9
|
target: keyof callKeysAnglesLiquid;
|
9
|
-
metaData?: keyof callKeysAnglesLiquid;
|
10
10
|
};
|
11
11
|
type callKeysAnglesLiquid = mandatoryCallKeys & {
|
12
12
|
poolToken: string;
|
@@ -26,7 +26,6 @@ export declare class AnglesLiquidProcessor extends GenericProcessor<callKeysAngl
|
|
26
26
|
round4: callType[];
|
27
27
|
};
|
28
28
|
processingRound5(_index: number, type: tokenType, typeInfo: dataRawAnglesLiquid, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeAnglesLiquid>;
|
29
|
-
computeRound1(type: tokenType, typeInfo: dataRawAnglesLiquid): tokenTypeStruct;
|
30
29
|
computeRound2(index: number, type: tokenType, typeInfo: dataRawAnglesLiquid, calls: string[]): tokenTypeStruct;
|
31
30
|
computeRound3(index: number, type: tokenType, typeInfo: dataRawAnglesLiquid, calls: string[]): tokenTypeStruct;
|
32
31
|
computeRound4(index: number, type: tokenType, typeInfo: dataRawAnglesLiquid, calls: string[], campaign: CampaignParameters<Campaign.ERC20>): tokenTypeStruct;
|
@@ -12,7 +12,6 @@ export class AnglesLiquidProcessor extends GenericProcessor {
|
|
12
12
|
{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" },
|
13
13
|
],
|
14
14
|
};
|
15
|
-
// override computeRound1(): void {}
|
16
15
|
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
17
16
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
18
17
|
const priceUnderlying = (await pricer.get({ symbol: "S" })) ?? 0;
|
@@ -29,13 +28,10 @@ export class AnglesLiquidProcessor extends GenericProcessor {
|
|
29
28
|
symbolUnderlyingToken,
|
30
29
|
totalAssets: typeInfo.totalAssets,
|
31
30
|
poolToken: typeInfo.poolToken,
|
32
|
-
cardName: generateCardName(type, typeInfo, campaign),
|
31
|
+
cardName: generateCardName(type, this.isStaking, typeInfo, campaign),
|
33
32
|
tokensDisplay: [{ symbol: symbolUnderlyingToken, address: typeInfo.poolToken }],
|
34
33
|
};
|
35
34
|
}
|
36
|
-
computeRound1(type, typeInfo) {
|
37
|
-
return super.computeRound1(type, typeInfo);
|
38
|
-
}
|
39
35
|
computeRound2(index, type, typeInfo, calls) {
|
40
36
|
return super.computeRound2(index, type, typeInfo, calls);
|
41
37
|
}
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import type { Pricer } from "@/utils/pricer";
|
2
2
|
import { type Campaign, type CampaignParameters } from "@sdk";
|
3
3
|
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "../GenericProcessor";
|
4
|
-
import { tokenType } from "../
|
4
|
+
import { tokenType } from "../constants";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawAsset;
|
7
7
|
call: string;
|
8
8
|
target: keyof callKeysAsset;
|
9
|
-
metaData?: keyof callKeysAsset;
|
10
9
|
optional?: boolean;
|
11
10
|
};
|
12
11
|
type callKeysAsset = mandatoryCallKeys & {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { generateCardName } from "@/utils/generateCardName";
|
2
2
|
import { BN2Number } from "@sdk";
|
3
3
|
import { GenericProcessor } from "../GenericProcessor";
|
4
|
-
import { tokenType } from "../
|
4
|
+
import { tokenType } from "../constants";
|
5
5
|
export class AssetProcessor extends GenericProcessor {
|
6
6
|
rounds = {
|
7
7
|
round1: [
|
@@ -41,7 +41,7 @@ export class AssetProcessor extends GenericProcessor {
|
|
41
41
|
exchangeRate,
|
42
42
|
whitelistedSupplyTargetToken,
|
43
43
|
blacklistedSupply,
|
44
|
-
cardName: generateCardName(type, typeInfo, campaign),
|
44
|
+
cardName: generateCardName(type, this.isStaking, typeInfo, campaign),
|
45
45
|
tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
|
46
46
|
};
|
47
47
|
}
|
@@ -2,12 +2,13 @@ import type { Pricer } from "@/utils/pricer";
|
|
2
2
|
import { type Campaign, type CampaignParameters } from "@sdk";
|
3
3
|
import type { BigNumber } from "ethers";
|
4
4
|
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "../GenericProcessor";
|
5
|
-
import type { tokenType
|
5
|
+
import type { tokenType } from "../constants";
|
6
|
+
import type { tokenTypeStruct } from "../interface";
|
6
7
|
type callType = {
|
7
8
|
key: keyof dataRawAura;
|
8
9
|
call: string;
|
9
10
|
target: keyof callKeysAura;
|
10
|
-
|
11
|
+
callArgs?: keyof callKeysAura;
|
11
12
|
};
|
12
13
|
type callKeysAura = mandatoryCallKeys & {
|
13
14
|
balancerPool: string;
|
@@ -15,19 +15,18 @@ export class AuraProcessor extends GenericProcessor {
|
|
15
15
|
{ key: "poolId", call: "getPoolId", target: "balancerPool" },
|
16
16
|
{ key: "vault", call: "getVault", target: "balancerPool" },
|
17
17
|
{ key: "totalSupplyBalancerPool", call: "totalSupply", target: "balancerPool" },
|
18
|
-
{ key: "gaugeContract", call: "poolInfo", target: "auraOperator",
|
18
|
+
{ key: "gaugeContract", call: "poolInfo", target: "auraOperator", callArgs: "pid" },
|
19
19
|
{ key: "auraStaker", call: "staker", target: "auraOperator" },
|
20
20
|
],
|
21
21
|
round3: [
|
22
|
-
{ key: "poolTokensRaw", call: "getPoolTokens", target: "vault",
|
23
|
-
{ key: "gaugeBalance", call: "balanceOf", target: "balancerPool",
|
24
|
-
{ key: "auraBalance", call: "balanceOf", target: "gaugeContract",
|
25
|
-
{ key: "vaultBalance", call: "balanceOf", target: "balancerPool",
|
22
|
+
{ key: "poolTokensRaw", call: "getPoolTokens", target: "vault", callArgs: "poolId" },
|
23
|
+
{ key: "gaugeBalance", call: "balanceOf", target: "balancerPool", callArgs: "gaugeContract" },
|
24
|
+
{ key: "auraBalance", call: "balanceOf", target: "gaugeContract", callArgs: "auraStaker" },
|
25
|
+
{ key: "vaultBalance", call: "balanceOf", target: "balancerPool", callArgs: "vault" },
|
26
26
|
{ key: "totalSupplyGauge", call: "totalSupply", target: "gaugeContract" },
|
27
27
|
],
|
28
28
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
29
29
|
};
|
30
|
-
// override computeRound1(): void {}
|
31
30
|
processingRound4(typeInfo) {
|
32
31
|
const tokens = typeInfo.poolTokensRaw[0];
|
33
32
|
const balances = typeInfo.poolTokensRaw[1];
|
@@ -88,7 +87,7 @@ export class AuraProcessor extends GenericProcessor {
|
|
88
87
|
blacklistedSupply,
|
89
88
|
tvl: tvl,
|
90
89
|
priceTargetToken: priceTargetToken,
|
91
|
-
cardName: generateCardName(type, typeInfo, campaign, symbols),
|
90
|
+
cardName: generateCardName(type, this.isStaking, typeInfo, campaign, symbols),
|
92
91
|
tokensDisplay,
|
93
92
|
};
|
94
93
|
}
|
@@ -2,12 +2,13 @@ import type { Pricer } from "@/utils/pricer";
|
|
2
2
|
import { type Campaign, type CampaignParameters } from "@sdk";
|
3
3
|
import type { BigNumber } from "ethers";
|
4
4
|
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "../GenericProcessor";
|
5
|
-
import type { tokenType
|
5
|
+
import type { tokenType } from "../constants";
|
6
|
+
import type { tokenTypeStruct } from "../interface";
|
6
7
|
type callType = {
|
7
8
|
key: keyof dataRawBG;
|
8
9
|
call: string;
|
9
10
|
target: keyof callKeysBG;
|
10
|
-
|
11
|
+
callArgs?: keyof callKeysBG;
|
11
12
|
};
|
12
13
|
type callKeysBG = mandatoryCallKeys & {
|
13
14
|
gyroscopeToken: string;
|