@merkl/api 0.20.65 → 0.20.67

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.
Files changed (130) hide show
  1. package/dist/src/engine/dynamicData/factory.js +2 -0
  2. package/dist/src/engine/dynamicData/implementations/Erc20.js +42 -80
  3. package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.d.ts +18 -18
  4. package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.js +30 -33
  5. package/dist/src/engine/erc20SubTypeProcessors/helpers/factoryFinder.d.ts +1 -1
  6. package/dist/src/engine/erc20SubTypeProcessors/helpers/factoryFinder.js +1 -1
  7. package/dist/src/engine/erc20SubTypeProcessors/helpers/hardcoded.d.ts +1 -1
  8. package/dist/src/engine/erc20SubTypeProcessors/helpers/hardcoded.js +1 -1
  9. package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.d.ts +1 -1
  10. package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.js +1 -1
  11. package/dist/src/engine/erc20SubTypeProcessors/{constants.d.ts → helpers/tokenType.d.ts} +6 -0
  12. package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.d.ts +2 -1
  13. package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.js +2 -1
  14. package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.d.ts +3 -2
  15. package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.js +5 -1
  16. package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.d.ts +2 -1
  17. package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.js +2 -2
  18. package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.d.ts +2 -3
  19. package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.js +7 -6
  20. package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.d.ts +2 -3
  21. package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +5 -4
  22. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.d.ts +2 -3
  23. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.js +4 -3
  24. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.d.ts +2 -3
  25. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.js +4 -3
  26. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.d.ts +2 -2
  27. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.js +2 -1
  28. package/dist/src/engine/erc20SubTypeProcessors/implementations/BeefyProcessor.d.ts +2 -2
  29. package/dist/src/engine/erc20SubTypeProcessors/implementations/BeefyProcessor.js +3 -3
  30. package/dist/src/engine/erc20SubTypeProcessors/implementations/BunniV2Processor.d.ts +2 -2
  31. package/dist/src/engine/erc20SubTypeProcessors/implementations/BunniV2Processor.js +2 -2
  32. package/dist/src/engine/erc20SubTypeProcessors/implementations/CompoundProcessor.d.ts +2 -2
  33. package/dist/src/engine/erc20SubTypeProcessors/implementations/CompoundProcessor.js +3 -2
  34. package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.d.ts +2 -1
  35. package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.js +1 -1
  36. package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.d.ts +2 -3
  37. package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.js +2 -2
  38. package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.d.ts +2 -1
  39. package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.js +1 -1
  40. package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.d.ts +2 -1
  41. package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.js +1 -1
  42. package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts +2 -1
  43. package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.js +1 -1
  44. package/dist/src/engine/erc20SubTypeProcessors/implementations/FluidProcessor.d.ts +2 -2
  45. package/dist/src/engine/erc20SubTypeProcessors/implementations/FluidProcessor.js +3 -2
  46. package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.d.ts +2 -1
  47. package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.js +2 -2
  48. package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.d.ts +3 -2
  49. package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.js +4 -1
  50. package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.d.ts +2 -2
  51. package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.js +3 -2
  52. package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.d.ts +2 -3
  53. package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.js +5 -4
  54. package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.d.ts +2 -1
  55. package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.js +1 -1
  56. package/dist/src/engine/erc20SubTypeProcessors/implementations/HourglassProcessor.d.ts +2 -2
  57. package/dist/src/engine/erc20SubTypeProcessors/implementations/HourglassProcessor.js +3 -2
  58. package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.d.ts +2 -2
  59. package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.js +2 -2
  60. package/dist/src/engine/erc20SubTypeProcessors/implementations/MetamorphoProcessor.d.ts +2 -2
  61. package/dist/src/engine/erc20SubTypeProcessors/implementations/MetamorphoProcessor.js +2 -1
  62. package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.d.ts +3 -2
  63. package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.js +6 -3
  64. package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.d.ts +2 -1
  65. package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.js +1 -1
  66. package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.d.ts +2 -1
  67. package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.js +1 -1
  68. package/dist/src/engine/erc20SubTypeProcessors/implementations/RadiantProcessor.d.ts +2 -2
  69. package/dist/src/engine/erc20SubTypeProcessors/implementations/RadiantProcessor.js +2 -1
  70. package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.d.ts +2 -2
  71. package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.js +6 -5
  72. package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.d.ts +2 -1
  73. package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.js +2 -1
  74. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.d.ts +2 -1
  75. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.js +1 -1
  76. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.d.ts +2 -1
  77. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.js +1 -1
  78. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.d.ts +1 -2
  79. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.js +1 -0
  80. package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.d.ts +2 -1
  81. package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.js +2 -1
  82. package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.d.ts +2 -2
  83. package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.js +2 -2
  84. package/dist/src/engine/erc20SubTypeProcessors/implementations/TemplateProcessor.d.ts +3 -2
  85. package/dist/src/engine/erc20SubTypeProcessors/implementations/TemplateProcessor.js +4 -0
  86. package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.d.ts +2 -1
  87. package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.js +2 -1
  88. package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.d.ts +2 -3
  89. package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.js +3 -3
  90. package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.d.ts +2 -1
  91. package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.js +1 -1
  92. package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.d.ts +2 -1
  93. package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.js +2 -1
  94. package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.d.ts +2 -2
  95. package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.js +7 -7
  96. package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.d.ts +2 -3
  97. package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.js +6 -5
  98. package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.d.ts +2 -1
  99. package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.js +3 -2
  100. package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.d.ts +6 -0
  101. package/dist/src/engine/erc20SubTypeProcessors/{factory.js → implementations/processorMapping.js} +48 -49
  102. package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.d.ts +2 -2
  103. package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.js +4 -3
  104. package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.d.ts +2 -2
  105. package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.js +4 -3
  106. package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.d.ts +4 -0
  107. package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.js +24 -0
  108. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.d.ts +3 -17
  109. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +62 -52
  110. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.d.ts +4 -0
  111. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.js +22 -0
  112. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.d.ts +3 -0
  113. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.js +22 -0
  114. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.d.ts +3 -0
  115. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.js +22 -0
  116. package/dist/src/engine/opportunityMetadata/factory.js +2 -0
  117. package/dist/src/engine/opportunityMetadata/implementations/CompoundV3.js +4 -1
  118. package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.js +1 -1
  119. package/dist/src/utils/decodeCalls.d.ts +1 -1
  120. package/dist/src/utils/decodeCalls.js +1 -1
  121. package/dist/src/utils/encodeCalls.d.ts +2 -2
  122. package/dist/src/utils/encodeCalls.js +15 -15
  123. package/dist/src/utils/generateCardName.d.ts +3 -4
  124. package/dist/src/utils/generateCardName.js +3 -3
  125. package/dist/src/utils/generateIcons.d.ts +3 -0
  126. package/dist/src/utils/generateIcons.js +65 -0
  127. package/dist/tsconfig.package.tsbuildinfo +1 -1
  128. package/package.json +1 -1
  129. package/dist/src/engine/erc20SubTypeProcessors/factory.d.ts +0 -6
  130. /package/dist/src/engine/erc20SubTypeProcessors/{constants.js → helpers/tokenType.js} +0 -0
@@ -58,5 +58,7 @@ const map = {
58
58
  [Campaign.ERC6909FIXAPR]: new DefaultDynamicData(), // TODO
59
59
  [Campaign.ERC1155]: new DefaultDynamicData(), // TODO
60
60
  [Campaign.ERC1155FIXAPR]: new DefaultDynamicData(), // TODO
61
+ [Campaign.ERC721]: new DefaultDynamicData(), // TODO
62
+ [Campaign.ERC721FIXAPR]: new DefaultDynamicData(), // TODO
61
63
  };
62
64
  export const dynamicDataBuilderFactory = (campaignType) => map[campaignType];
@@ -1,6 +1,9 @@
1
- import { tokenType } from "@/engine/erc20SubTypeProcessors/constants";
2
- import { erc20ProcessorFactory } from "@/engine/erc20SubTypeProcessors/factory";
1
+ import { tokenType } from "@/engine/erc20SubTypeProcessors/helpers/tokenType";
2
+ import { getTokenPricesInfo } from "@/engine/erc20SubTypeProcessors/subtypesPrices";
3
3
  import { getTokenTypeRound1 } from "@/engine/erc20SubTypeProcessors/subtypesRound1";
4
+ import { getTokenTypeRound2 } from "@/engine/erc20SubTypeProcessors/subtypesRound2";
5
+ import { getTokenTypeRound3 } from "@/engine/erc20SubTypeProcessors/subtypesRound3";
6
+ import { getTokenTypeRound4 } from "@/engine/erc20SubTypeProcessors/subtypesRound4";
4
7
  import { ComputedValueService } from "@/modules/v4/computedValue";
5
8
  import { TokenRepository } from "@/modules/v4/token/token.repository";
6
9
  import { TokenService } from "@/modules/v4/token/token.service";
@@ -13,13 +16,12 @@ export class Erc20DynamicData {
13
16
  const pricer = await Pricer.load();
14
17
  // Round 1: Get the high level type for each token (will need to be refined lated with more calls)
15
18
  const callsRounds1 = [];
16
- const tokenTypeDataByCampaign = {};
19
+ const tokenTypesByCampaign = {};
17
20
  for (const campaign of campaigns) {
18
21
  const typeStruct = {
19
22
  type: tokenType.unknown,
20
23
  calls: [],
21
24
  typeInfo: {},
22
- processor: erc20ProcessorFactory(tokenType.unknown, campaign),
23
25
  };
24
26
  const targetToken = campaign.campaignParameters.targetToken;
25
27
  typeStruct.calls = [
@@ -60,114 +62,74 @@ export class Erc20DynamicData {
60
62
  },
61
63
  ];
62
64
  callsRounds1.push(...typeStruct.calls);
63
- tokenTypeDataByCampaign[campaign.campaignId] = typeStruct;
65
+ tokenTypesByCampaign[campaign.campaignId] = typeStruct;
64
66
  }
65
- const resultRound1 = (await ChainInteractionService(chainId).fetchState(callsRounds1)).map(x => x.returnData);
67
+ const resultRound1 = await ChainInteractionService(chainId).fetchState(callsRounds1);
66
68
  // Round 2: Decode result from round 1 and get some additional info for the types before the final calls
67
69
  const callsRounds2 = [];
68
70
  let i = 0;
69
71
  for (const campaign of campaigns) {
70
- const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
71
- const callsForCampaign = tokenTypeData.calls.length;
72
- const res = getTokenTypeRound1(resultRound1, i, campaign); // TODO use processor
73
- tokenTypeData.calls = res.calls;
74
- tokenTypeData.typeInfo = res.typeInfo;
75
- tokenTypeData.processor = erc20ProcessorFactory(res.type, campaign);
72
+ const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
73
+ tokenTypesByCampaign[campaign.campaignId] = getTokenTypeRound1(resultRound1, campaign.campaignParameters.targetToken, i, campaign);
76
74
  i += callsForCampaign;
77
- callsRounds2.push(...tokenTypeDataByCampaign[campaign.campaignId].calls);
75
+ callsRounds2.push(...tokenTypesByCampaign[campaign.campaignId].calls);
78
76
  }
79
- const resultRound2 = (await ChainInteractionService(chainId).fetchState(callsRounds2)).map(x => x.returnData);
77
+ const resultRound2 = await ChainInteractionService(chainId).fetchState(callsRounds2);
80
78
  // Round 3: Decode result from round 2 and get some additional info for the types before the final calls
81
79
  const callsRounds3 = [];
82
80
  let j = 0;
83
81
  for (const campaign of campaigns) {
84
- const { processor, typeInfo } = tokenTypeDataByCampaign[campaign.campaignId];
85
- const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
86
- const callsForCampaign = tokenTypeData.calls.length;
87
- try {
88
- const res = await processor.computeRound2(j, processor.type, typeInfo, resultRound2, campaign);
89
- tokenTypeData.calls = res.calls;
90
- tokenTypeData.typeInfo = res.typeInfo;
91
- }
92
- catch {
93
- // In case something goes wrong, we set following calls to void an move on
94
- tokenTypeData.calls = [];
95
- tokenTypeData.typeInfo = typeInfo;
96
- }
82
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
83
+ const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
84
+ tokenTypesByCampaign[campaign.campaignId] = getTokenTypeRound2(j, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, resultRound2, campaign);
97
85
  j += callsForCampaign;
98
- callsRounds3.push(...tokenTypeDataByCampaign[campaign.campaignId].calls);
86
+ callsRounds3.push(...tokenTypesByCampaign[campaign.campaignId].calls);
99
87
  }
100
- const resultRound3 = (await ChainInteractionService(chainId).fetchState(callsRounds3)).map(x => x.returnData);
88
+ const resultRound3 = await ChainInteractionService(chainId).fetchState(callsRounds3);
101
89
  // Final round before execute
102
- let callsRounds4 = [];
90
+ let callsFinal = [];
103
91
  j = 0;
104
92
  for (const campaign of campaigns) {
105
- const { processor, typeInfo } = tokenTypeDataByCampaign[campaign.campaignId];
106
- const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
107
- const callsForCampaign = tokenTypeData.calls.length;
108
- try {
109
- const res = await processor.computeRound3(j, processor.type, typeInfo, resultRound3);
110
- tokenTypeData.calls = res.calls;
111
- tokenTypeData.typeInfo = res.typeInfo;
112
- }
113
- catch {
114
- // In case something goes wrong, we set following calls to void an move on
115
- tokenTypeData.calls = [];
116
- tokenTypeData.typeInfo = typeInfo;
117
- }
93
+ const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
94
+ tokenTypesByCampaign[campaign.campaignId] = getTokenTypeRound3(j, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, resultRound3);
118
95
  j += callsForCampaign;
119
- callsRounds4 = callsRounds4.concat(tokenTypeDataByCampaign[campaign.campaignId].calls);
96
+ callsFinal = callsFinal.concat(tokenTypesByCampaign[campaign.campaignId].calls);
120
97
  }
121
98
  // Round 4: Get the final data
122
- const resultRound4 = (await ChainInteractionService(chainId).fetchState(callsRounds4)).map(x => x.returnData);
99
+ const resultsFinal = await ChainInteractionService(chainId).fetchState(callsFinal);
123
100
  j = 0;
124
101
  let calls = [];
125
102
  for (const campaign of campaigns) {
126
- const { processor, typeInfo } = tokenTypeDataByCampaign[campaign.campaignId];
127
- const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
128
- const callsForCampaign = tokenTypeData.calls.length;
129
- try {
130
- const res = await processor.computeRound4(j, processor.type, typeInfo, resultRound4, campaign);
131
- tokenTypeData.calls = res.calls;
132
- tokenTypeData.typeInfo = res.typeInfo;
133
- }
134
- catch {
135
- // In case something goes wrong, we set following calls to void an move on
136
- tokenTypeData.calls = [];
137
- tokenTypeData.typeInfo = typeInfo;
138
- }
103
+ const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
104
+ tokenTypesByCampaign[campaign.campaignId] = getTokenTypeRound4(j, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, resultsFinal, campaign);
139
105
  j += callsForCampaign;
140
- calls = calls.concat(tokenTypeDataByCampaign[campaign.campaignId].calls);
106
+ calls = calls.concat(tokenTypesByCampaign[campaign.campaignId].calls);
141
107
  }
142
- const resultFinal = (await ChainInteractionService(chainId).fetchState(calls)).map(x => x.returnData);
108
+ const result = await ChainInteractionService(chainId).fetchState(calls);
143
109
  i = 0;
144
110
  const dynamicData = [];
145
111
  for (const campaign of campaigns) {
112
+ // const priceRewardToken =
113
+ // (await pricer.get({
114
+ // address: campaign.rewardToken,
115
+ // chainId,
116
+ // symbol: campaign.campaignParameters.symbolRewardToken,
117
+ // })) ?? 0;
146
118
  const priceRewardToken = await TokenService.getRewardTokenPrice(campaign);
147
- const { processor, typeInfo } = tokenTypeDataByCampaign[campaign.campaignId];
148
- const tokenTypeData = tokenTypeDataByCampaign[campaign.campaignId];
149
- const callsForCampaign = tokenTypeData.calls.length;
150
- try {
151
- const res = await processor.computeRound5(j, processor.type, typeInfo, resultFinal, campaign, pricer);
152
- tokenTypeData.calls = res.calls;
153
- tokenTypeData.typeInfo = res.typeInfo;
154
- }
155
- catch {
156
- // In case something goes wrong, we set following calls to void an move on
157
- tokenTypeData.calls = [];
158
- tokenTypeData.typeInfo = typeInfo;
159
- }
119
+ // Get the data from the final round and process it to get the price of the target token and some extra info
120
+ const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
121
+ tokenTypesByCampaign[campaign.campaignId] = await getTokenPricesInfo(i, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, result.map(r => r.returnData), campaign, pricer);
160
122
  try {
161
- if (!!tokenTypeDataByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken && getEnv() === "prod")
162
- await TokenRepository.updateAddressPrices(campaign.campaignParameters.targetToken, tokenTypeDataByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken);
123
+ if (!!tokenTypesByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken && getEnv() === "prod")
124
+ await TokenRepository.updateAddressPrices(campaign.campaignParameters.targetToken, tokenTypesByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken);
163
125
  }
164
126
  catch (e) {
165
127
  log.warn(`failed to update target token price: ${e}`);
166
128
  }
167
129
  i += callsForCampaign;
168
- let whitelistedSupplyTargetToken = tokenTypeDataByCampaign[campaign.campaignId].typeInfo.whitelistedSupplyTargetToken;
130
+ let whitelistedSupplyTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.whitelistedSupplyTargetToken;
169
131
  const totalSupplyTargetToken = whitelistedSupplyTargetToken;
170
- const priceTargetToken = tokenTypeDataByCampaign[campaign.campaignId].typeInfo.priceTargetToken;
132
+ const priceTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.priceTargetToken;
171
133
  let lastEligibilityRatio = 1;
172
134
  if (!!campaign.campaignParameters.hooks?.length) {
173
135
  lastEligibilityRatio =
@@ -203,15 +165,15 @@ export class Erc20DynamicData {
203
165
  apr = getFixedApr(campaign, priceRewardToken, priceTargetToken);
204
166
  }
205
167
  if (campaign.chainId === ChainId.ETHERLINK) {
206
- whitelistedSupplyTargetToken = tokenTypeDataByCampaign[campaign.campaignId].typeInfo.totalSupply;
168
+ whitelistedSupplyTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.totalSupply;
207
169
  }
208
170
  dynamicData.push({
209
171
  ...campaign,
210
172
  apr,
211
173
  totalSupplyTargetToken,
212
174
  tvl: whitelistedSupplyTargetToken * priceTargetToken,
213
- type: processor.type,
214
- typeInfo,
175
+ type: tokenTypesByCampaign[campaign.campaignId].type,
176
+ typeInfo: tokenTypesByCampaign[campaign.campaignId].typeInfo,
215
177
  priceRewardToken: priceRewardToken,
216
178
  lastEligibilityRatio,
217
179
  });
@@ -1,8 +1,7 @@
1
1
  import type { Pricer } from "@/utils/pricer";
2
- import { type CallDto, type CampaignParameters } from "@sdk";
2
+ import { type CallDto, type Campaign, type CampaignParameters } from "@sdk";
3
3
  import type { ERC20SupportedCampaignType } from "../dynamicData/implementations/Erc20";
4
- import { type tokenType } from "./constants";
5
- import type { tokenTypeStruct } from "./interface";
4
+ import { type tokenType, type tokenTypeStruct } from "./helpers/tokenType";
6
5
  export declare enum Round {
7
6
  one = "round1",
8
7
  two = "round2",
@@ -10,13 +9,14 @@ export declare enum Round {
10
9
  four = "round4"
11
10
  }
12
11
  export type callType = {
13
- key: string;
14
- call: string;
15
- target: string;
16
- callArgs?: string;
12
+ key: any;
13
+ call: any;
14
+ target: any;
15
+ metaData?: any;
17
16
  optional?: boolean;
18
17
  };
19
18
  export type mandatoryCallKeys = {
19
+ type: tokenType;
20
20
  protocol: string;
21
21
  tokenAddress: string;
22
22
  blacklistedSupply: string;
@@ -28,8 +28,11 @@ 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;
31
35
  };
32
- export type callKeys = mandatoryCallKeys & Record<string, string>;
33
36
  export type dataRaw = {
34
37
  protocol: string;
35
38
  tokenAddress: string;
@@ -39,6 +42,7 @@ export type dataRaw = {
39
42
  } & stakingKeys;
40
43
  export type dataType = {
41
44
  protocol: string;
45
+ type: tokenType;
42
46
  tokenAddress: string;
43
47
  totalSupply: number;
44
48
  blacklistedSupply: number;
@@ -59,11 +63,6 @@ export type dataType = {
59
63
  * @params Output - Final output of the processor
60
64
  */
61
65
  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);
67
66
  rounds: {
68
67
  round1: callType[];
69
68
  round2: callType[];
@@ -76,23 +75,24 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
76
75
  round3: callType[];
77
76
  round4: callType[];
78
77
  };
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<ERC20SupportedCampaignType>): {
83
+ handleWhiteListBlacklistRound5(typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): {
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<ERC20SupportedCampaignType>, pricer: Pricer): Promise<Output>;
89
- computeRound1(typeInfo: DataRaw): tokenTypeStruct;
88
+ processingRound5(_index: number, type: tokenType, typeInfo: DataRaw, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<Output>;
89
+ computeRound1(type: tokenType, 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<ERC20SupportedCampaignType>): CallDto[];
95
- generateBlackListCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<ERC20SupportedCampaignType>): CallDto[];
94
+ generateWhitelistCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
95
+ generateBlackListCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): 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";
4
5
  import { BN2Number } from "@sdk";
5
- import { tokenTypeToProtocolAndAction } from "./constants";
6
- import { parseForStaking } from "./subtypesRound1";
6
+ import { tokenTypeToProtocolAndAction } from "./helpers/tokenType";
7
7
  export var Round;
8
8
  (function (Round) {
9
9
  Round["one"] = "round1";
@@ -19,16 +19,6 @@ 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
- }
32
22
  rounds = {
33
23
  round1: [],
34
24
  round2: [],
@@ -46,6 +36,7 @@ export class GenericProcessor {
46
36
  round3: [],
47
37
  round4: [],
48
38
  };
39
+ debug = false;
49
40
  processingRound1(_typeInfo) { }
50
41
  processingRound2(_typeInfo, _campaign) { }
51
42
  processingRound3(_typeInfo) { }
@@ -78,38 +69,38 @@ export class GenericProcessor {
78
69
  priceTargetToken,
79
70
  tvl,
80
71
  blacklistedSupply,
81
- cardName: generateCardName(type, this.isStaking, typeInfo, campaign),
72
+ cardName: generateCardName(type, typeInfo, campaign),
82
73
  tokensDisplay: [{ symbol: campaign.campaignParameters.symbolTargetToken, address: typeInfo.tokenAddress }],
83
74
  };
84
75
  }
85
- computeRound1(typeInfo) {
86
- typeInfo = { type: this.type, ...tokenTypeToProtocolAndAction[this.type], ...typeInfo };
76
+ computeRound1(type, typeInfo) {
77
+ typeInfo = { type, ...tokenTypeToProtocolAndAction[type], ...typeInfo };
87
78
  this.processingRound1(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));
79
+ let calls = this.encodeNextRound(Round.one, type, typeInfo);
80
+ if (typeInfo.isStaking === "true") {
81
+ calls = calls.concat(this.encodeStakingNextRound(Round.one, type, typeInfo));
91
82
  }
92
83
  if (this.debug) {
93
84
  console.log("Round 1", {
94
- type: this.type,
85
+ type: type,
95
86
  calls,
96
87
  typeInfo,
97
88
  });
98
89
  }
99
90
  return {
100
- type: this.type,
91
+ type: type,
101
92
  calls,
102
93
  typeInfo,
103
94
  };
104
95
  }
105
96
  computeRound2(index, type, typeInfo, calls, campaign) {
106
97
  this.decodePreviousRound(Round.one, calls, typeInfo, type, index);
107
- if (this.isStaking) {
98
+ if (typeInfo.isStaking === "true") {
108
99
  this.decodePreviousStakingRound(Round.one, calls, typeInfo, type, index + this.rounds.round1.length);
109
100
  }
110
101
  this.processingRound2(typeInfo, campaign);
111
102
  let nextCalls = this.encodeNextRound(Round.two, type, typeInfo);
112
- if (this.isStaking) {
103
+ if (typeInfo.isStaking === "true") {
113
104
  nextCalls = nextCalls.concat(this.encodeStakingNextRound(Round.two, type, typeInfo));
114
105
  }
115
106
  if (this.debug) {
@@ -127,12 +118,12 @@ export class GenericProcessor {
127
118
  }
128
119
  computeRound3(index, type, typeInfo, calls) {
129
120
  this.decodePreviousRound(Round.two, calls, typeInfo, type, index);
130
- if (this.isStaking) {
121
+ if (typeInfo.isStaking === "true") {
131
122
  this.decodePreviousStakingRound(Round.two, calls, typeInfo, type, index + this.rounds.round2.length);
132
123
  }
133
124
  this.processingRound3(typeInfo);
134
125
  let nextCalls = this.encodeNextRound(Round.three, type, typeInfo);
135
- if (this.isStaking) {
126
+ if (typeInfo.isStaking === "true") {
136
127
  nextCalls = nextCalls.concat(this.encodeStakingNextRound(Round.three, type, typeInfo));
137
128
  }
138
129
  if (this.debug) {
@@ -152,12 +143,12 @@ export class GenericProcessor {
152
143
  const blacklistedLiquidityCalls = this.generateBlackListCall(type, typeInfo, campaign);
153
144
  const whitelistedLiquidityCalls = this.generateWhitelistCall(type, typeInfo, campaign);
154
145
  this.decodePreviousRound(Round.three, calls, typeInfo, type, index);
155
- if (this.isStaking) {
146
+ if (typeInfo.isStaking === "true") {
156
147
  this.decodePreviousStakingRound(Round.three, calls, typeInfo, type, index + this.rounds.round3.length);
157
148
  }
158
149
  this.processingRound4(typeInfo);
159
150
  let nextCalls = this.encodeNextRound(Round.four, type, typeInfo);
160
- if (this.isStaking) {
151
+ if (typeInfo.isStaking === "true") {
161
152
  nextCalls = nextCalls.concat(this.encodeStakingNextRound(Round.four, type, typeInfo));
162
153
  }
163
154
  if (this.debug) {
@@ -181,7 +172,7 @@ export class GenericProcessor {
181
172
  typeInfo.blacklistedSupply = this.decodeListedSupply(index, campaign.campaignParameters.blacklist, calls);
182
173
  index = index + campaign.campaignParameters.blacklist.length;
183
174
  this.decodePreviousRound(Round.four, calls, typeInfo, type, index);
184
- if (this.isStaking) {
175
+ if (typeInfo.isStaking === "true") {
185
176
  this.decodePreviousStakingRound(Round.four, calls, typeInfo, type, index + this.rounds.round4.length);
186
177
  }
187
178
  const outputInfo = (await this.processingRound5(index, type, typeInfo, calls, campaign, pricer));
@@ -189,13 +180,19 @@ export class GenericProcessor {
189
180
  console.log("Round 5", {
190
181
  type: type,
191
182
  calls: [],
192
- typeInfo: outputInfo,
183
+ typeInfo: {
184
+ ...outputInfo,
185
+ icons: generateIcons(type, typeInfo, campaign),
186
+ },
193
187
  });
194
188
  }
195
189
  return {
196
190
  type: type,
197
191
  calls: [],
198
- typeInfo: outputInfo,
192
+ typeInfo: {
193
+ ...outputInfo,
194
+ icons: generateIcons(type, typeInfo, campaign),
195
+ },
199
196
  };
200
197
  }
201
198
  generateWhitelistCall(type, typeInfo, campaign) {
@@ -277,12 +274,12 @@ export class GenericProcessor {
277
274
  }
278
275
  encodeRound(round, callInfo, type) {
279
276
  return round
280
- .map(({ call, target, callArgs, optional }) => {
281
- if (!optional && !callInfo[target]) {
277
+ .map(({ call, target, metaData, optional }) => {
278
+ if (optional && !callInfo[target]) {
282
279
  return [];
283
280
  }
284
- if (callArgs) {
285
- return createCall(callInfo[target], call, type, callInfo[callArgs]);
281
+ if (metaData) {
282
+ return createCall(callInfo[target], call, type, callInfo[metaData]);
286
283
  }
287
284
  return createCall(callInfo[target], call, type);
288
285
  })
@@ -1,4 +1,4 @@
1
- import { tokenType } from "../constants";
1
+ import { tokenType } from "./tokenType";
2
2
  export declare function getTypeFromFactoryAddress(address: string): tokenType;
3
3
  export declare const enzymeFundValueCalculatorRouterMapping: {
4
4
  [address: string]: string;
@@ -1,4 +1,4 @@
1
- import { tokenType } from "../constants";
1
+ import { tokenType } from "./tokenType";
2
2
  const factoryAddresses = {
3
3
  "0x420DD381b31aEf6683db6B902084cB0FFECe40Da": tokenType.aerodrome, // Aerodrome Base Factory
4
4
  "0x31832f2a97Fd20664D76Cc421207669b55CE4BC0": tokenType.velodrome, // Velodrome Mode Factory
@@ -1,3 +1,3 @@
1
1
  import { ChainId } from "@sdk";
2
- import { tokenType } from "../constants";
2
+ import { tokenType } from "./tokenType";
3
3
  export declare function getTypeFromAddressChain(chain: ChainId, token: string): tokenType;
@@ -1,5 +1,5 @@
1
1
  import { ChainId } from "@sdk";
2
- import { tokenType } from "../constants";
2
+ import { tokenType } from "./tokenType";
3
3
  const chainAddressToType = {
4
4
  [ChainId.CORN]: {
5
5
  "0xab3291b73a1087265e126e330cede0cfd4b8a693": tokenType.curveNPool,
@@ -1,2 +1,2 @@
1
- import { tokenType } from "../constants";
1
+ import { tokenType } from "./tokenType";
2
2
  export declare function getTypeFromOwnerAddress(address: string): tokenType;
@@ -1,4 +1,4 @@
1
- import { tokenType } from "../constants";
1
+ import { tokenType } from "./tokenType";
2
2
  const ownerAddresses = {
3
3
  "0xbF7E49483881C76487b0989CD7d9A8239B20CA41": tokenType.curve_2,
4
4
  "0x42a856dbEBB97AbC1269EAB32f3bb40C15102819": tokenType.satlayer,
@@ -1,5 +1,6 @@
1
1
  import type { ProtocolId } from "@/modules/v4/protocol/protocol.model";
2
2
  import { OpportunityAction } from "@db/api";
3
+ import type { CallDto } from "@sdk";
3
4
  export declare enum tokenType {
4
5
  aura = "aura",
5
6
  anglesLiquid = "anglesLiquid",
@@ -102,3 +103,8 @@ export declare const tokenTypeToProtocolAndAction: Record<tokenType, {
102
103
  protocol: ProtocolId | undefined;
103
104
  action: OpportunityAction;
104
105
  }>;
106
+ export type tokenTypeStruct = {
107
+ type: tokenType;
108
+ calls: CallDto[];
109
+ typeInfo: any;
110
+ };
@@ -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 "../constants";
4
+ import type { tokenType } from "../helpers/tokenType";
5
5
  type callType = {
6
6
  key: keyof dataRawAave;
7
7
  call: string;
8
8
  target: keyof callKeysAave;
9
+ metaData?: keyof callKeysAave;
9
10
  };
10
11
  export type callKeysAave = mandatoryCallKeys & {
11
12
  underlying: string;
@@ -7,6 +7,7 @@ export class AaveProcessor extends GenericProcessor {
7
7
  round3: [],
8
8
  round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
9
9
  };
10
+ // // override computeRound1(): void {}
10
11
  async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
11
12
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
12
13
  const priceTargetToken = (await pricer.get({ symbol: typeInfo.symbolUnderlyingToken })) ?? 0;
@@ -16,7 +17,7 @@ export class AaveProcessor extends GenericProcessor {
16
17
  whitelistedSupplyTargetToken,
17
18
  tvl: tvl,
18
19
  priceTargetToken,
19
- cardName: generateCardName(type, this.isStaking, typeInfo, campaign),
20
+ cardName: generateCardName(type, typeInfo, campaign),
20
21
  blacklistedSupply,
21
22
  totalSupply,
22
23
  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 } from "../constants";
5
- import type { tokenTypeStruct } from "../interface";
4
+ import type { tokenType, tokenTypeStruct } from "../helpers/tokenType";
6
5
  type callType = {
7
6
  key: keyof dataRawAnglesLiquid;
8
7
  call: string;
9
8
  target: keyof callKeysAnglesLiquid;
9
+ metaData?: keyof callKeysAnglesLiquid;
10
10
  };
11
11
  type callKeysAnglesLiquid = mandatoryCallKeys & {
12
12
  poolToken: string;
@@ -26,6 +26,7 @@ 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;
29
30
  computeRound2(index: number, type: tokenType, typeInfo: dataRawAnglesLiquid, calls: string[]): tokenTypeStruct;
30
31
  computeRound3(index: number, type: tokenType, typeInfo: dataRawAnglesLiquid, calls: string[]): tokenTypeStruct;
31
32
  computeRound4(index: number, type: tokenType, typeInfo: dataRawAnglesLiquid, calls: string[], campaign: CampaignParameters<Campaign.ERC20>): tokenTypeStruct;
@@ -12,6 +12,7 @@ export class AnglesLiquidProcessor extends GenericProcessor {
12
12
  { key: "totalSupply", call: "totalSupply", target: "tokenAddress" },
13
13
  ],
14
14
  };
15
+ // override computeRound1(): void {}
15
16
  async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
16
17
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
17
18
  const priceUnderlying = (await pricer.get({ symbol: "S" })) ?? 0;
@@ -28,10 +29,13 @@ export class AnglesLiquidProcessor extends GenericProcessor {
28
29
  symbolUnderlyingToken,
29
30
  totalAssets: typeInfo.totalAssets,
30
31
  poolToken: typeInfo.poolToken,
31
- cardName: generateCardName(type, this.isStaking, typeInfo, campaign),
32
+ cardName: generateCardName(type, typeInfo, campaign),
32
33
  tokensDisplay: [{ symbol: symbolUnderlyingToken, address: typeInfo.poolToken }],
33
34
  };
34
35
  }
36
+ computeRound1(type, typeInfo) {
37
+ return super.computeRound1(type, typeInfo);
38
+ }
35
39
  computeRound2(index, type, typeInfo, calls) {
36
40
  return super.computeRound2(index, type, typeInfo, calls);
37
41
  }
@@ -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 "../constants";
4
+ import { tokenType } from "../helpers/tokenType";
5
5
  type callType = {
6
6
  key: keyof dataRawAsset;
7
7
  call: string;
8
8
  target: keyof callKeysAsset;
9
+ metaData?: keyof callKeysAsset;
9
10
  optional?: boolean;
10
11
  };
11
12
  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 "../constants";
4
+ import { tokenType } from "../helpers/tokenType";
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, this.isStaking, typeInfo, campaign),
44
+ cardName: generateCardName(type, typeInfo, campaign),
45
45
  tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
46
46
  };
47
47
  }