@merkl/api 0.10.196 → 0.10.198

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.
@@ -61,7 +61,11 @@ export async function merklChainData(chainId) {
61
61
  const lastTreeRoot = DistributorInterface.decodeFunctionResult("lastTree", result[i++].returnData)[0]?.toString();
62
62
  const endOfDisputePeriod = BN2Number(DistributorInterface.decodeFunctionResult("endOfDisputePeriod", result[i++].returnData)[0], 0);
63
63
  const disputeLive = DistributorInterface.decodeFunctionResult("disputer", result[i++].returnData)[0] !== NULL_ADDRESS;
64
- const message = DistributorCreatorInterface.decodeFunctionResult("message", result[i++].returnData)[0]?.toString();
64
+ let message = "";
65
+ try {
66
+ message = DistributorCreatorInterface.decodeFunctionResult("message", result[i++].returnData)[0]?.toString();
67
+ }
68
+ catch { }
65
69
  const validRewardTokens = DistributorCreatorInterface.decodeFunctionResult("getValidRewardTokens()", result[i++].returnData)[0].map((t) => {
66
70
  const decimals = tokens[t.token]?.decimals
67
71
  ? tokens[t.token]?.decimals
@@ -107,6 +111,8 @@ export async function merklChainData(chainId) {
107
111
  return acc;
108
112
  }, []);
109
113
  const validRewardTokenRes = await batchMulticallCallWithRetry(chainId, { calls: validRewardTokensCalls });
114
+ if (chainId === 1101)
115
+ console.log(validRewardTokenRes);
110
116
  for (let index = 0; index < validRewardTokens.length; index++) {
111
117
  try {
112
118
  if (validRewardTokenRes[2 * index][0] &&
@@ -1,5 +1,5 @@
1
1
  import type { CampaignUnique, CreateCampaignModel, GetCampaignQueryModel } from "./";
2
- import { type Prisma } from "../../../../database/api/.generated";
2
+ import { Prisma } from "../../../../database/api/.generated";
3
3
  import { type ChainId } from "@sdk";
4
4
  import { type OpportunityMetadata } from "../opportunity";
5
5
  export declare abstract class CampaignRepository {
@@ -2,7 +2,7 @@ import { CampaignService } from "./";
2
2
  import { log } from "../../../utils/logger";
3
3
  import { apiDbClient, engineDbClient } from "../../../utils/prisma";
4
4
  import { ALL_CAMPAIGNS_FOR_CHAIN_AFTER } from "../../../utils/queries/allCampaigns";
5
- import { RunStatus, Status } from "../../../../database/api/.generated";
5
+ import { Prisma, RunStatus, Status } from "../../../../database/api/.generated";
6
6
  import { MAX_COMPUTE_JOB_TIME, WEEK } from "@sdk";
7
7
  import moment from "moment";
8
8
  import { OpportunityService } from "../opportunity";
@@ -264,8 +264,8 @@ export class CampaignRepository {
264
264
  startTimestamp: { lte: currentTime }, // The campaign has started
265
265
  endTimestamp: { gte: currentTime - WEEK }, // The campaign ended less than a week ago
266
266
  params: {
267
- path: ["shouldIgnore"], // There is no "shouldIgnore" flag in the api database
268
- not: "true",
267
+ path: ["shouldIgnore"],
268
+ equals: Prisma.AnyNull,
269
269
  },
270
270
  CampaignStatus: {
271
271
  some: {
@@ -279,7 +279,7 @@ export class CampaignRepository {
279
279
  {
280
280
  status: RunStatus.PROCESSING,
281
281
  processingStarted: {
282
- lt: currentTime - MAX_COMPUTE_JOB_TIME,
282
+ lt: currentTime - MAX_COMPUTE_JOB_TIME, // more than 12 hours ago
283
283
  },
284
284
  },
285
285
  ],