@merkl/api 0.10.266 → 0.10.267

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ export async function VestDynamicData(_chainId, campaigns) {
24
24
  for (const campaign of campaigns) {
25
25
  let totalSupply;
26
26
  try {
27
- totalSupply = ERC20Interface.decodeFunctionResult("balanceOf", result[i++])[0];
27
+ totalSupply = BN2Number(ERC20Interface.decodeFunctionResult("balanceOf", result[i++])[0], 6);
28
28
  }
29
29
  catch {
30
30
  log.warn(`Error getting totalSupply for campaign ${campaign.campaignId}`);
@@ -38,7 +38,7 @@ export async function VestDynamicData(_chainId, campaigns) {
38
38
  const priceTargetToken = (await pricer.get({
39
39
  address: VEST_TOKEN,
40
40
  chainId: campaign.computeChainId,
41
- symbol: VEST_TOKEN,
41
+ symbol: "USDC.e",
42
42
  })) ?? 0;
43
43
  const tvl = totalSupply * priceTargetToken;
44
44
  dynamicData.push({
@@ -15,7 +15,7 @@ export class CampaignService {
15
15
  }
16
16
  static async create(campaign) {
17
17
  const id = CampaignService.hashId({ distributionChain: campaign.chainId, campaignId: campaign.campaignId });
18
- await OpportunityService.createFromCampaign(campaign); // TODO REMOVE TRUE
18
+ await OpportunityService.createFromCampaign(campaign);
19
19
  return await CampaignRepository.upsert({ id, ...campaign });
20
20
  }
21
21
  static async createMany(campaigns) {
@@ -25,7 +25,7 @@ export class CampaignService {
25
25
  const id = CampaignService.hashId({ distributionChain: campaign.chainId, campaignId: campaign.campaignId });
26
26
  campaign.computeChainId = campaign.computeChainId === 0 ? campaign.chainId : campaign.computeChainId;
27
27
  try {
28
- await OpportunityService.createFromCampaign(campaign, true); // TODO REMOVE TRUE
28
+ await OpportunityService.createFromCampaign(campaign);
29
29
  campaignsToInsert.push({ id, ...campaign });
30
30
  }
31
31
  catch (err) {