@merkl/api 0.20.66 → 0.20.68
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/engine/dynamicData/implementations/Erc20.js +42 -80
- package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.d.ts +18 -18
- package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.js +30 -33
- 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/{constants.d.ts → helpers/tokenType.d.ts} +6 -0
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.js +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.js +5 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.js +7 -6
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +5 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.js +4 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.js +4 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.js +2 -1
- 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 +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts +2 -1
- 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 +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.js +4 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.js +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.js +5 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.d.ts +2 -1
- 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 +3 -2
- 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 +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.js +6 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.d.ts +2 -1
- 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 +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.js +6 -5
- package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.js +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.d.ts +1 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.js +1 -0
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.js +2 -1
- 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 +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TemplateProcessor.js +4 -0
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.js +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.js +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.js +2 -1
- 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 +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.js +6 -5
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.js +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.d.ts +6 -0
- package/dist/src/engine/erc20SubTypeProcessors/{factory.js → implementations/processorMapping.js} +48 -49
- package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.js +4 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.js +4 -3
- package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.d.ts +4 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.js +24 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.d.ts +3 -17
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +62 -52
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.d.ts +4 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.js +22 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.d.ts +3 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.js +22 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.d.ts +3 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.js +22 -0
- package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.js +1 -1
- package/dist/src/modules/v4/token/token.service.js +3 -1
- 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 +3 -4
- package/dist/src/utils/generateCardName.js +3 -3
- package/dist/src/utils/generateIcons.d.ts +3 -0
- package/dist/src/utils/generateIcons.js +65 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/factory.d.ts +0 -6
- /package/dist/src/engine/erc20SubTypeProcessors/{constants.js → helpers/tokenType.js} +0 -0
@@ -1,13 +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 } from "../
|
5
|
-
import type { tokenTypeStruct } from "../interface";
|
4
|
+
import type { tokenType, tokenTypeStruct } from "../helpers/tokenType";
|
6
5
|
type callType = {
|
7
6
|
key: keyof dataRawUni;
|
8
7
|
call: string;
|
9
8
|
target: keyof callKeysUni;
|
10
|
-
|
9
|
+
metaData?: keyof callKeysUni;
|
11
10
|
};
|
12
11
|
type callKeysUni = mandatoryCallKeys & {
|
13
12
|
token0: string;
|
@@ -13,8 +13,8 @@ export class UniswapProcessor extends GenericProcessor {
|
|
13
13
|
{ key: "symbolToken1", call: "symbol", target: "token1" },
|
14
14
|
{ key: "decimalsToken0", call: "decimals", target: "token0" },
|
15
15
|
{ key: "decimalsToken1", call: "decimals", target: "token1" },
|
16
|
-
{ key: "balanceToken0", call: "balanceOf", target: "token0",
|
17
|
-
{ key: "balanceToken1", call: "balanceOf", target: "token1",
|
16
|
+
{ key: "balanceToken0", call: "balanceOf", target: "token0", metaData: "tokenAddress" },
|
17
|
+
{ key: "balanceToken1", call: "balanceOf", target: "token1", metaData: "tokenAddress" },
|
18
18
|
],
|
19
19
|
round3: [],
|
20
20
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
@@ -58,7 +58,7 @@ export class UniswapProcessor extends GenericProcessor {
|
|
58
58
|
whitelistedSupplyTargetToken,
|
59
59
|
blacklistedSupply,
|
60
60
|
tvl,
|
61
|
-
cardName: generateCardName(type,
|
61
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
62
62
|
decimalsToken0,
|
63
63
|
decimalsToken1,
|
64
64
|
balanceToken0,
|
@@ -1,11 +1,12 @@
|
|
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 "../helpers/tokenType";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawVicuna;
|
7
7
|
call: string;
|
8
8
|
target: keyof callKeysVicuna;
|
9
|
+
metaData?: any;
|
9
10
|
};
|
10
11
|
type callKeysVicuna = mandatoryCallKeys & {
|
11
12
|
tokenPrice: string;
|
@@ -29,7 +29,7 @@ export class VicunaProcessor extends GenericProcessor {
|
|
29
29
|
whitelistedSupplyTargetToken,
|
30
30
|
blacklistedSupply,
|
31
31
|
priceTargetToken,
|
32
|
-
cardName: generateCardName(type,
|
32
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
33
33
|
tokensDisplay: [{ symbol: campaign.campaignParameters.symbolTargetToken, address: typeInfo.tokenAddress }],
|
34
34
|
};
|
35
35
|
}
|
@@ -1,11 +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 } from "../
|
4
|
+
import type { tokenType } from "../helpers/tokenType";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawBeefy;
|
7
7
|
call: string;
|
8
8
|
target: keyof callKeysBeefy;
|
9
|
+
metaData?: keyof callKeysBeefy;
|
9
10
|
};
|
10
11
|
type callKeysBeefy = mandatoryCallKeys & {
|
11
12
|
decimalsToken: string;
|
@@ -15,6 +15,7 @@ export class WoofiProcessor extends GenericProcessor {
|
|
15
15
|
round3: [],
|
16
16
|
round4: [],
|
17
17
|
};
|
18
|
+
// override computeRound1(): void {}
|
18
19
|
async processingRound5(index, type, typeInfo, calls, campaign, pricer) {
|
19
20
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
20
21
|
const priceToken = (await pricer.get({ symbol: typeInfo.symbolUnderlyingToken })) ?? 0;
|
@@ -31,7 +32,7 @@ export class WoofiProcessor extends GenericProcessor {
|
|
31
32
|
totalSupply,
|
32
33
|
whitelistedSupplyTargetToken,
|
33
34
|
blacklistedSupply,
|
34
|
-
cardName: generateCardName(type,
|
35
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
35
36
|
pricePerShare,
|
36
37
|
tvl,
|
37
38
|
tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
|
package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.d.ts
CHANGED
@@ -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 } from "../
|
4
|
+
import type { tokenType } from "../helpers/tokenType";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawzkSwapThreePool;
|
7
7
|
call: string;
|
8
8
|
target: keyof callKeysZkswapThreePool;
|
9
|
-
|
9
|
+
metaData?: keyof callKeysZkswapThreePool;
|
10
10
|
};
|
11
11
|
type callKeysZkswapThreePool = mandatoryCallKeys & {
|
12
12
|
balances: string;
|
@@ -5,12 +5,12 @@ export class ZkSwapThreePoolProcessor extends GenericProcessor {
|
|
5
5
|
rounds = {
|
6
6
|
round1: [{ key: "pool", call: "minter", target: "tokenAddress" }],
|
7
7
|
round2: [
|
8
|
-
{ key: "token0Address", call: "coins", target: "pool",
|
9
|
-
{ key: "balance0", call: "balances", target: "pool",
|
10
|
-
{ key: "token1Address", call: "coins", target: "pool",
|
11
|
-
{ key: "balance1", call: "balances", target: "pool",
|
12
|
-
{ key: "token2Address", call: "coins", target: "pool",
|
13
|
-
{ key: "balance2", call: "balances", target: "pool",
|
8
|
+
{ key: "token0Address", call: "coins", target: "pool", metaData: "token0Index" },
|
9
|
+
{ key: "balance0", call: "balances", target: "pool", metaData: "token0Index" },
|
10
|
+
{ key: "token1Address", call: "coins", target: "pool", metaData: "token1Index" },
|
11
|
+
{ key: "balance1", call: "balances", target: "pool", metaData: "token1Index" },
|
12
|
+
{ key: "token2Address", call: "coins", target: "pool", metaData: "token2Index" },
|
13
|
+
{ key: "balance2", call: "balances", target: "pool", metaData: "token2Index" },
|
14
14
|
],
|
15
15
|
round3: [
|
16
16
|
{ key: "symbolToken0", call: "symbol", target: "token0Address" },
|
@@ -45,7 +45,7 @@ export class ZkSwapThreePoolProcessor extends GenericProcessor {
|
|
45
45
|
return {
|
46
46
|
...rest,
|
47
47
|
blacklistedSupply,
|
48
|
-
cardName: generateCardName(type,
|
48
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
49
49
|
priceTargetToken: priceTargetToken,
|
50
50
|
totalSupply,
|
51
51
|
tvl,
|
@@ -1,13 +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 } from "../
|
5
|
-
import type { tokenTypeStruct } from "../interface";
|
4
|
+
import type { tokenType, tokenTypeStruct } from "../helpers/tokenType";
|
6
5
|
type callType = {
|
7
6
|
key: keyof dataRawCurveN;
|
8
7
|
call: string;
|
9
8
|
target: keyof callKeysCurveN;
|
10
|
-
|
9
|
+
metaData?: keyof callKeysCurveN | string;
|
11
10
|
optional?: boolean;
|
12
11
|
};
|
13
12
|
type callKeysCurveN = mandatoryCallKeys & {
|
@@ -12,12 +12,13 @@ export class CurveNPoolProcessor extends GenericProcessor {
|
|
12
12
|
round3: [],
|
13
13
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
14
14
|
};
|
15
|
+
// override computeRound1(): void {}
|
15
16
|
processingRound2(typeInfo) {
|
16
17
|
typeInfo.numberTokens = Number(typeInfo.numberTokens);
|
17
18
|
for (let i = 0; i < typeInfo.numberTokens; i++) {
|
18
19
|
typeInfo[`${i}`] = i.toString();
|
19
20
|
this.rounds.round2 = this.rounds.round2.concat([
|
20
|
-
{ key: `token${i}`, call: "coins", target: "tokenAddress",
|
21
|
+
{ key: `token${i}`, call: "coins", target: "tokenAddress", metaData: i.toString() },
|
21
22
|
]);
|
22
23
|
}
|
23
24
|
}
|
@@ -26,14 +27,14 @@ export class CurveNPoolProcessor extends GenericProcessor {
|
|
26
27
|
this.rounds.round3 = this.rounds.round3.concat([
|
27
28
|
{ key: `symbolToken${i}`, call: "symbol", target: `token${i}` },
|
28
29
|
{ key: `decimalsToken${i}`, call: "decimals", target: `token${i}` },
|
29
|
-
{ key: `balanceToken${i}`, call: "balances", target: "tokenAddress",
|
30
|
+
{ key: `balanceToken${i}`, call: "balances", target: "tokenAddress", metaData: i.toString() },
|
30
31
|
]);
|
31
32
|
}
|
32
33
|
}
|
33
34
|
computeRound3(index, type, typeInfo, calls) {
|
34
35
|
for (let i = 0; i < typeInfo.numberTokens; i++) {
|
35
36
|
this.rounds.round2 = this.rounds.round2.concat([
|
36
|
-
{ key: `token${i}`, call: "coins", target: "tokenAddress",
|
37
|
+
{ key: `token${i}`, call: "coins", target: "tokenAddress", metaData: i.toString() },
|
37
38
|
]);
|
38
39
|
}
|
39
40
|
return super.computeRound3(index, type, typeInfo, calls);
|
@@ -43,7 +44,7 @@ export class CurveNPoolProcessor extends GenericProcessor {
|
|
43
44
|
this.rounds.round3 = this.rounds.round3.concat([
|
44
45
|
{ key: `symbolToken${i}`, call: "symbol", target: `token${i}` },
|
45
46
|
{ key: `decimalsToken${i}`, call: "decimals", target: `token${i}` },
|
46
|
-
{ key: `balanceToken${i}`, call: "balances", target: "tokenAddress",
|
47
|
+
{ key: `balanceToken${i}`, call: "balances", target: "tokenAddress", metaData: i.toString() },
|
47
48
|
]);
|
48
49
|
}
|
49
50
|
return super.computeRound4(index, type, typeInfo, calls, campaign);
|
@@ -90,7 +91,7 @@ export class CurveNPoolProcessor extends GenericProcessor {
|
|
90
91
|
whitelistedSupplyTargetToken,
|
91
92
|
blacklistedSupply,
|
92
93
|
priceTargetToken,
|
93
|
-
cardName: generateCardName(type,
|
94
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
94
95
|
tokensDisplay,
|
95
96
|
};
|
96
97
|
}
|
@@ -1,11 +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 { tokenType } from "../
|
4
|
+
import { tokenType } from "../helpers/tokenType";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawCurve;
|
7
7
|
call: string;
|
8
8
|
target: keyof callKeysCurve;
|
9
|
+
metaData?: keyof callKeysCurve;
|
9
10
|
optional?: boolean;
|
10
11
|
};
|
11
12
|
type callKeysCurve = 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 "../helpers/tokenType";
|
5
5
|
export class CurveProcessor extends GenericProcessor {
|
6
6
|
rounds = {
|
7
7
|
round1: [
|
@@ -18,6 +18,7 @@ export class CurveProcessor extends GenericProcessor {
|
|
18
18
|
round3: [],
|
19
19
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
20
20
|
};
|
21
|
+
// override computeRound1(): void {}
|
21
22
|
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
22
23
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
23
24
|
const lp_price = BN2Number(typeInfo.lp_price, 18);
|
@@ -73,7 +74,7 @@ export class CurveProcessor extends GenericProcessor {
|
|
73
74
|
whitelistedSupplyTargetToken,
|
74
75
|
blacklistedSupply,
|
75
76
|
priceTargetToken,
|
76
|
-
cardName: generateCardName(type,
|
77
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
77
78
|
tokensDisplay,
|
78
79
|
};
|
79
80
|
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { GenericProcessor } from "../GenericProcessor";
|
2
|
+
import type { callKeys, dataRaw, dataType } from "../GenericProcessor";
|
3
|
+
import { tokenType } from "../helpers/tokenType";
|
4
|
+
export declare const processorMapping: {
|
5
|
+
[key in tokenType]: typeof GenericProcessor<callKeys, dataRaw, dataType>;
|
6
|
+
};
|
package/dist/src/engine/erc20SubTypeProcessors/{factory.js → implementations/processorMapping.js}
RENAMED
@@ -1,51 +1,51 @@
|
|
1
|
-
import { GenericProcessor } from "
|
2
|
-
import { tokenType } from "
|
3
|
-
import { AaveProcessor } from "./
|
4
|
-
import { AnglesLiquidProcessor } from "./
|
5
|
-
import { AssetProcessor } from "./
|
6
|
-
import { AuraProcessor } from "./
|
7
|
-
import { BEXRewardGaugeProcessor } from "./
|
8
|
-
import { BalancerGaugeProcessor } from "./
|
9
|
-
import { BalancerPoolProcessor } from "./
|
10
|
-
import { BalancerV3PoolProcessor } from "./
|
11
|
-
import { BeefyProcessor } from "./
|
12
|
-
import { BunniV2Processor } from "./
|
13
|
-
import { CompoundProcessor } from "./
|
14
|
-
import { ERC4626Processor } from "./
|
15
|
-
import { EnzymeProcessor } from "./
|
16
|
-
import { EqualizerGaugeProcessor } from "./
|
17
|
-
import { EulerBorrowProcessor } from "./
|
18
|
-
import { EulerLendProcessor } from "./
|
19
|
-
import { FluidProcessor } from "./
|
20
|
-
import { FraxProcessor } from "./
|
21
|
-
import { GammaProcessor } from "./
|
22
|
-
import { GearboxProcessor } from "./
|
23
|
-
import { HanjiVaultProcessor } from "./
|
24
|
-
import { HoldStationProcessor } from "./
|
25
|
-
import { HourglassProcessor } from "./
|
26
|
-
import { MaverickBPProcessor } from "./
|
27
|
-
import { MetamorphoProcessor } from "./
|
28
|
-
import { NoLinkVaultProcessor } from "./
|
29
|
-
import { PendleProcessor } from "./
|
30
|
-
import { PendleYTProcessor } from "./
|
31
|
-
import { RadiantProcessor } from "./
|
32
|
-
import { RfxProcessor } from "./
|
33
|
-
import { SatlayerProcessor } from "./
|
34
|
-
import { SpectraProcessor } from "./
|
35
|
-
import { SpectraYTProcessor } from "./
|
36
|
-
import { SpliceProcessor } from "./
|
37
|
-
import { SturdySiloProcessor } from "./
|
38
|
-
import { TempestVaultProcessor } from "./
|
39
|
-
import { TorosProcessor } from "./
|
40
|
-
import { UniswapProcessor } from "./
|
41
|
-
import { VicunaProcessor } from "./
|
42
|
-
import { WoofiProcessor } from "./
|
43
|
-
import { ZkSwapThreePoolProcessor } from "./
|
44
|
-
import { CurveNPoolProcessor } from "./
|
45
|
-
import { CurveProcessor } from "./
|
46
|
-
import { StakedCurveProcessor } from "./
|
47
|
-
import { xU308Processor } from "./
|
48
|
-
const
|
1
|
+
import { GenericProcessor } from "../GenericProcessor";
|
2
|
+
import { tokenType } from "../helpers/tokenType";
|
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
|
+
export const processorMapping = {
|
49
49
|
[tokenType.uniswapv2]: UniswapProcessor,
|
50
50
|
[tokenType.balancerGauge]: BalancerGaugeProcessor,
|
51
51
|
[tokenType.balancerPool]: BalancerPoolProcessor,
|
@@ -143,4 +143,3 @@ const map = {
|
|
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,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 { tokenType } from "../
|
4
|
+
import { tokenType } from "../helpers/tokenType";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawStakedCurve;
|
7
7
|
call: string;
|
8
8
|
target: keyof callKeysStakedCurve;
|
9
|
-
|
9
|
+
metaData?: keyof callKeysStakedCurve;
|
10
10
|
optional?: boolean;
|
11
11
|
};
|
12
12
|
type callKeysStakedCurve = mandatoryCallKeys & {
|
@@ -2,7 +2,7 @@ import { generateCardName } from "@/utils/generateCardName";
|
|
2
2
|
import { BN2Number } from "@sdk";
|
3
3
|
import { BigNumber } from "ethers";
|
4
4
|
import { GenericProcessor } from "../GenericProcessor";
|
5
|
-
import { tokenType } from "../
|
5
|
+
import { tokenType } from "../helpers/tokenType";
|
6
6
|
export class StakedCurveProcessor extends GenericProcessor {
|
7
7
|
rounds = {
|
8
8
|
round1: [{ key: "underlying", call: "underlying", target: "tokenAddress" }],
|
@@ -19,10 +19,11 @@ export class StakedCurveProcessor extends GenericProcessor {
|
|
19
19
|
{ key: "symbolToken2", call: "symbol", target: "token2", optional: true },
|
20
20
|
],
|
21
21
|
round4: [
|
22
|
-
{ key: "toAssets", call: "convertToAssets", target: "tokenAddress",
|
22
|
+
{ key: "toAssets", call: "convertToAssets", target: "tokenAddress", metaData: "amount" },
|
23
23
|
{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" },
|
24
24
|
],
|
25
25
|
};
|
26
|
+
// override computeRound1(): void {}
|
26
27
|
processingRound3(typeInfo) {
|
27
28
|
typeInfo.amount = BigNumber.from(10).pow(18).toString();
|
28
29
|
}
|
@@ -80,7 +81,7 @@ export class StakedCurveProcessor extends GenericProcessor {
|
|
80
81
|
whitelistedSupplyTargetToken,
|
81
82
|
blacklistedSupply,
|
82
83
|
priceTargetToken,
|
83
|
-
cardName: generateCardName(type,
|
84
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
84
85
|
tokensDisplay,
|
85
86
|
};
|
86
87
|
}
|
@@ -1,12 +1,12 @@
|
|
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 "../helpers/tokenType";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawxU308;
|
7
7
|
call: string;
|
8
8
|
target: keyof callKeysxU308;
|
9
|
-
|
9
|
+
metaData?: keyof callKeysxU308;
|
10
10
|
};
|
11
11
|
type callKeysxU308 = mandatoryCallKeys & {
|
12
12
|
pool: string;
|
@@ -13,11 +13,12 @@ export class xU308Processor extends GenericProcessor {
|
|
13
13
|
{ key: "symbolToken1", call: "symbol", target: "_token1" },
|
14
14
|
{ key: "decimalsToken0", call: "decimals", target: "_token0" },
|
15
15
|
{ key: "decimalsToken1", call: "decimals", target: "_token1" },
|
16
|
-
{ key: "balanceToken0", call: "balanceOf", target: "_token0",
|
17
|
-
{ key: "balanceToken1", call: "balanceOf", target: "_token1",
|
16
|
+
{ key: "balanceToken0", call: "balanceOf", target: "_token0", metaData: "pool" },
|
17
|
+
{ key: "balanceToken1", call: "balanceOf", target: "_token1", metaData: "pool" },
|
18
18
|
],
|
19
19
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
20
20
|
};
|
21
|
+
// override computeRound1(): void {}
|
21
22
|
processingRound2(typeInfo) {
|
22
23
|
typeInfo.pool = "0xB387D0A73619791420De4a1e5e710023Cb0f49c0";
|
23
24
|
}
|
@@ -34,7 +35,7 @@ export class xU308Processor extends GenericProcessor {
|
|
34
35
|
blacklistedSupply,
|
35
36
|
priceTargetToken,
|
36
37
|
totalSupply,
|
37
|
-
cardName: generateCardName(type,
|
38
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
38
39
|
tokensDisplay: [{ symbol: campaign.campaignParameters.symbolTargetToken, address: typeInfo.tokenAddress }],
|
39
40
|
};
|
40
41
|
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type { Pricer } from "@/utils/pricer";
|
2
|
+
import type { Campaign, CampaignParameters } from "@sdk";
|
3
|
+
import { tokenType, type tokenTypeStruct } from "./helpers/tokenType";
|
4
|
+
export declare function getTokenPricesInfo(index: number, type: tokenType, typeInfo: any, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<tokenTypeStruct>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { tokenType } from "./helpers/tokenType";
|
2
|
+
import { processorMapping } from "./implementations/processorMapping";
|
3
|
+
export async function getTokenPricesInfo(index, type, typeInfo, calls, campaign, pricer) {
|
4
|
+
const ProcessorClass = processorMapping[type];
|
5
|
+
try {
|
6
|
+
if (!ProcessorClass) {
|
7
|
+
throw new Error(`Processor not found for key: ${type}`);
|
8
|
+
}
|
9
|
+
const processorObject = new ProcessorClass();
|
10
|
+
return processorObject.computeRound5(index, type, typeInfo, calls, campaign, pricer);
|
11
|
+
}
|
12
|
+
catch (error) {
|
13
|
+
console.error(error);
|
14
|
+
return {
|
15
|
+
type: tokenType.unknown,
|
16
|
+
calls: [],
|
17
|
+
typeInfo: {
|
18
|
+
totalSupply: 0,
|
19
|
+
blacklistedSupply: 0,
|
20
|
+
priceTargetToken: 0,
|
21
|
+
},
|
22
|
+
};
|
23
|
+
}
|
24
|
+
}
|
@@ -1,17 +1,3 @@
|
|
1
|
-
import type { CampaignParameters } from "@sdk";
|
2
|
-
import type
|
3
|
-
|
4
|
-
declare function generateResult(type: tokenType, name: string, campaign: CampaignParameters<ERC20SupportedCampaignType>, data?: {
|
5
|
-
owner?: string;
|
6
|
-
factory?: string;
|
7
|
-
fundValueCalculator?: string;
|
8
|
-
dispatcher?: string;
|
9
|
-
}): import("./interface").tokenTypeStruct;
|
10
|
-
export declare function parseForStaking(campaign: CampaignParameters<ERC20SupportedCampaignType>): {
|
11
|
-
isStaking: false;
|
12
|
-
} | {
|
13
|
-
isStaking: true;
|
14
|
-
stakingContract: string;
|
15
|
-
};
|
16
|
-
export declare function getTokenTypeRound1(callResults: string[], index: number, campaign: CampaignParameters<ERC20SupportedCampaignType>): ReturnType<typeof generateResult>;
|
17
|
-
export {};
|
1
|
+
import type { Campaign, CampaignParameters, ResultDto } from "@sdk";
|
2
|
+
import { type tokenTypeStruct } from "./helpers/tokenType";
|
3
|
+
export declare function getTokenTypeRound1(calls: ResultDto[], targetToken: string, index: number, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): tokenTypeStruct;
|