@merkl/api 0.16.6 → 0.16.8

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 (61) hide show
  1. package/dist/src/backgroundJobs/jobs/campaignsCacheUpdater.js +3 -1
  2. package/dist/src/backgroundJobs/jobs/priceUpdater.js +1 -1
  3. package/dist/src/eden/index.d.ts +182 -177
  4. package/dist/src/index.d.ts +38 -37
  5. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/BalancerV3PoolProcessor.js +9 -1
  6. package/dist/src/libs/getTokensList.d.ts +0 -10
  7. package/dist/src/libs/getTokensList.js +1 -21
  8. package/dist/src/libs/merklChainData.js +4 -24
  9. package/dist/src/libs/tokens/balances.js +2 -2
  10. package/dist/src/modules/v4/accounting/accounting.controller.d.ts +2 -2
  11. package/dist/src/modules/v4/accounting/accounting.repository.d.ts +16 -16
  12. package/dist/src/modules/v4/accounting/accounting.service.d.ts +2 -2
  13. package/dist/src/modules/v4/boost/boost.service.js +6 -2
  14. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +3 -3
  15. package/dist/src/modules/v4/campaign/campaign.model.d.ts +1 -1
  16. package/dist/src/modules/v4/campaign/campaign.model.js +1 -1
  17. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +15 -15
  18. package/dist/src/modules/v4/campaign/campaign.service.d.ts +1 -1
  19. package/dist/src/modules/v4/claims/claims.controller.d.ts +1 -1
  20. package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +1 -1
  21. package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +2 -2
  22. package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +8 -11
  23. package/dist/src/modules/v4/dynamicData/dynamicData.service.js +0 -8
  24. package/dist/src/modules/v4/liquidity/implementations/AjnaPositionFetcher.d.ts +1 -1
  25. package/dist/src/modules/v4/liquidity/implementations/DolomitePositionFetcher.d.ts +1 -1
  26. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +5 -5
  27. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +5 -5
  28. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +87 -87
  29. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +5 -5
  30. package/dist/src/modules/v4/reward/reward.controller.d.ts +3 -3
  31. package/dist/src/modules/v4/reward/reward.model.d.ts +1 -1
  32. package/dist/src/modules/v4/reward/reward.model.js +1 -1
  33. package/dist/src/modules/v4/reward/reward.repository.d.ts +3 -3
  34. package/dist/src/modules/v4/reward/reward.service.d.ts +7 -7
  35. package/dist/src/modules/v4/router.d.ts +32 -31
  36. package/dist/src/modules/v4/router.js +20 -20
  37. package/dist/src/modules/v4/status/status.controller.d.ts +12 -12
  38. package/dist/src/modules/v4/status/status.repository.d.ts +12 -12
  39. package/dist/src/modules/v4/status/status.service.d.ts +12 -12
  40. package/dist/src/modules/v4/token/token.controller.d.ts +1 -0
  41. package/dist/src/modules/v4/token/token.model.d.ts +1 -0
  42. package/dist/src/modules/v4/token/token.model.js +1 -0
  43. package/dist/src/modules/v4/token/token.service.d.ts +13 -0
  44. package/dist/src/modules/v4/token/token.service.js +6 -17
  45. package/dist/src/modules/v4/user/user.controller.d.ts +3 -3
  46. package/dist/src/routes/v3/lostyield.js +6 -3
  47. package/dist/src/routes/v3/opportunity.d.ts +1 -1
  48. package/dist/src/routes/v3/rewards.d.ts +1 -1
  49. package/dist/src/routes/v3/rewardsReport.d.ts +1 -1
  50. package/dist/src/routes/v3/router.d.ts +4 -4
  51. package/dist/src/routes/v3/userRewards.d.ts +1 -1
  52. package/dist/src/utils/generateCardName.js +0 -4
  53. package/dist/src/utils/prices/priceService.js +1 -1
  54. package/dist/tsconfig.package.tsbuildinfo +1 -1
  55. package/package.json +1 -1
  56. package/dist/src/modules/v4/dynamicData/index.d.ts +0 -3
  57. package/dist/src/modules/v4/dynamicData/index.js +0 -3
  58. package/dist/src/modules/v4/index.d.ts +0 -4
  59. package/dist/src/modules/v4/index.js +0 -4
  60. package/dist/src/modules/v4/liquidity/index.d.ts +0 -2
  61. package/dist/src/modules/v4/liquidity/index.js +0 -2
@@ -236,7 +236,7 @@ declare const app: Elysia<"", false, {
236
236
  } & {
237
237
  price?: number | null | undefined;
238
238
  })[];
239
- mainProtocol: "morpho" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "euler" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "coumpound" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | undefined;
239
+ mainProtocol: "morpho" | "euler" | "ambient" | "arthswap" | "baseswap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "koi" | "supswap-v3" | "zkswap" | "thirdtrade" | "uniswapv4" | "uniswap-v2" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap-v3" | "neptune" | "zkSwapThreePool" | "syncswap" | "rfx" | "radiant" | "aave" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "coumpound" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | undefined;
240
240
  depositUrl: any;
241
241
  tags: string[];
242
242
  };
@@ -413,6 +413,7 @@ declare const app: Elysia<"", false, {
413
413
  tags: string[];
414
414
  icon: string;
415
415
  } | null | undefined;
416
+ depositUrl?: string | undefined;
416
417
  aprRecord?: {
417
418
  timestamp: string | bigint;
418
419
  cumulated: number;
@@ -424,7 +425,6 @@ declare const app: Elysia<"", false, {
424
425
  aprRecordId: string;
425
426
  }[];
426
427
  } | undefined;
427
- depositUrl?: string | undefined;
428
428
  tvlRecord?: {
429
429
  total: number;
430
430
  timestamp: string | bigint;
@@ -517,11 +517,11 @@ declare const app: Elysia<"", false, {
517
517
  startTimestamp?: string | undefined;
518
518
  endTimestamp?: string | undefined;
519
519
  tokenAddress?: string | undefined;
520
- mainParameter?: string | undefined;
521
520
  campaignId?: string | undefined;
522
521
  opportunityId?: string | undefined;
523
522
  creatorAddress?: string | undefined;
524
523
  creatorId?: string | undefined;
524
+ mainParameter?: string | undefined;
525
525
  test?: boolean | undefined;
526
526
  creatorTag?: string | undefined;
527
527
  tokenSymbol?: string | undefined;
@@ -537,6 +537,7 @@ declare const app: Elysia<"", false, {
537
537
  tags: string[];
538
538
  icon: string;
539
539
  } | null | undefined;
540
+ depositUrl?: string | undefined;
540
541
  aprRecord?: {
541
542
  timestamp: string | bigint;
542
543
  cumulated: number;
@@ -548,7 +549,6 @@ declare const app: Elysia<"", false, {
548
549
  aprRecordId: string;
549
550
  }[];
550
551
  } | undefined;
551
- depositUrl?: string | undefined;
552
552
  tvlRecord?: {
553
553
  total: number;
554
554
  timestamp: string | bigint;
@@ -701,6 +701,7 @@ declare const app: Elysia<"", false, {
701
701
  tags: string[];
702
702
  icon: string;
703
703
  } | null | undefined;
704
+ depositUrl?: string | undefined;
704
705
  aprRecord?: {
705
706
  timestamp: string | bigint;
706
707
  cumulated: number;
@@ -712,7 +713,6 @@ declare const app: Elysia<"", false, {
712
713
  aprRecordId: string;
713
714
  }[];
714
715
  } | undefined;
715
- depositUrl?: string | undefined;
716
716
  tvlRecord?: {
717
717
  total: number;
718
718
  timestamp: string | bigint;
@@ -1094,11 +1094,11 @@ declare const app: Elysia<"", false, {
1094
1094
  startTimestamp?: string | undefined;
1095
1095
  endTimestamp?: string | undefined;
1096
1096
  tokenAddress?: string | undefined;
1097
- mainParameter?: string | undefined;
1098
1097
  campaignId?: string | undefined;
1099
1098
  opportunityId?: string | undefined;
1100
1099
  creatorAddress?: string | undefined;
1101
1100
  creatorId?: string | undefined;
1101
+ mainParameter?: string | undefined;
1102
1102
  test?: boolean | undefined;
1103
1103
  creatorTag?: string | undefined;
1104
1104
  tokenSymbol?: string | undefined;
@@ -1173,11 +1173,11 @@ declare const app: Elysia<"", false, {
1173
1173
  startTimestamp?: string | undefined;
1174
1174
  endTimestamp?: string | undefined;
1175
1175
  tokenAddress?: string | undefined;
1176
- mainParameter?: string | undefined;
1177
1176
  campaignId?: string | undefined;
1178
1177
  opportunityId?: string | undefined;
1179
1178
  creatorAddress?: string | undefined;
1180
1179
  creatorId?: string | undefined;
1180
+ mainParameter?: string | undefined;
1181
1181
  test?: boolean | undefined;
1182
1182
  creatorTag?: string | undefined;
1183
1183
  tokenSymbol?: string | undefined;
@@ -1201,10 +1201,10 @@ declare const app: Elysia<"", false, {
1201
1201
  response: {
1202
1202
  200: {
1203
1203
  endTimestamp: bigint;
1204
+ campaignId: string;
1204
1205
  CampaignStatus: {
1205
1206
  computedUntil: bigint;
1206
1207
  }[];
1207
- campaignId: string;
1208
1208
  }[];
1209
1209
  };
1210
1210
  };
@@ -1528,6 +1528,7 @@ declare const app: Elysia<"", false, {
1528
1528
  params: {};
1529
1529
  query: {
1530
1530
  tokenAddress?: string | undefined;
1531
+ verified?: boolean | undefined;
1531
1532
  additionalTokenAddresses?: string[] | undefined;
1532
1533
  chainId: number;
1533
1534
  userAddress: string;
@@ -1878,10 +1879,10 @@ declare const app: Elysia<"", false, {
1878
1879
  post: {
1879
1880
  body: {
1880
1881
  pending: string;
1881
- recipient: string;
1882
1882
  distributionChainId: number;
1883
1883
  amount: string;
1884
1884
  root: string;
1885
+ recipient: string;
1885
1886
  claimed: string;
1886
1887
  proofs: string[];
1887
1888
  rewardToken: string;
@@ -1912,8 +1913,8 @@ declare const app: Elysia<"", false, {
1912
1913
  protocolId?: string | undefined;
1913
1914
  reason: string;
1914
1915
  pending: string;
1915
- recipient: string;
1916
1916
  amount: string;
1917
+ recipient: string;
1917
1918
  claimed: string;
1918
1919
  }[];
1919
1920
  }[];
@@ -1937,8 +1938,8 @@ declare const app: Elysia<"", false, {
1937
1938
  body: {
1938
1939
  token: string;
1939
1940
  chainId: number;
1940
- recipient: string;
1941
1941
  root: string;
1942
+ recipient: string;
1942
1943
  }[];
1943
1944
  params: {};
1944
1945
  query: unknown;
@@ -2568,12 +2569,12 @@ declare const app: Elysia<"", false, {
2568
2569
  claimed: bigint;
2569
2570
  amount: bigint;
2570
2571
  pending: bigint;
2571
- recipient: string;
2572
2572
  root: string;
2573
+ recipient: string;
2573
2574
  proofs: string[];
2574
2575
  }, "breakdowns"> & {
2575
2576
  breakdowns: {
2576
- opportunity: import("./modules/v4").Opportunity["model"];
2577
+ opportunity: import("./modules/v4/opportunity").Opportunity["model"];
2577
2578
  claimed: bigint;
2578
2579
  amount: bigint;
2579
2580
  pending: bigint;
@@ -2681,8 +2682,8 @@ declare const app: Elysia<"", false, {
2681
2682
  claimed: bigint;
2682
2683
  amount: bigint;
2683
2684
  pending: bigint;
2684
- recipient: string;
2685
2685
  root: string;
2686
+ recipient: string;
2686
2687
  proofs: string[];
2687
2688
  }, "breakdowns"> & {
2688
2689
  breakdowns: {
@@ -2934,13 +2935,13 @@ declare const app: Elysia<"", false, {
2934
2935
  id: string;
2935
2936
  timestamp: number;
2936
2937
  chainId: number;
2938
+ datetime: Date;
2939
+ recipient: string;
2937
2940
  fromTokenId: string;
2938
2941
  toTokenId: string;
2939
2942
  multisig: string;
2940
- recipient: string;
2941
2943
  amountIn: string;
2942
2944
  amountOut: string;
2943
- datetime: Date;
2944
2945
  }[];
2945
2946
  };
2946
2947
  };
@@ -3155,13 +3156,13 @@ declare const app: Elysia<"", false, {
3155
3156
  chainId?: number | undefined;
3156
3157
  startTimestamp?: string | undefined;
3157
3158
  endTimestamp?: string | undefined;
3158
- campaignStatus?: {} | undefined;
3159
3159
  distributionChainId?: number | undefined;
3160
3160
  campaignId?: string | undefined;
3161
3161
  rewardTokenId?: string | undefined;
3162
3162
  amount?: string | undefined;
3163
3163
  opportunityId?: string | undefined;
3164
3164
  creatorAddress?: string | undefined;
3165
+ campaignStatus?: {} | undefined;
3165
3166
  rewardToken?: {} | undefined;
3166
3167
  rewardTokenAddress?: string | undefined;
3167
3168
  distributionChain?: {} | undefined;
@@ -3196,11 +3197,11 @@ declare const app: Elysia<"", false, {
3196
3197
  startTimestamp?: string | undefined;
3197
3198
  endTimestamp?: string | undefined;
3198
3199
  tokenAddress?: string | undefined;
3199
- mainParameter?: string | undefined;
3200
3200
  campaignId?: string | undefined;
3201
3201
  opportunityId?: string | undefined;
3202
3202
  creatorAddress?: string | undefined;
3203
3203
  creatorId?: string | undefined;
3204
+ mainParameter?: string | undefined;
3204
3205
  test?: boolean | undefined;
3205
3206
  creatorTag?: string | undefined;
3206
3207
  tokenSymbol?: string | undefined;
@@ -3335,18 +3336,6 @@ declare const app: Elysia<"", false, {
3335
3336
  computedUntil: bigint;
3336
3337
  startTimestamp: bigint;
3337
3338
  endTimestamp: bigint;
3338
- CampaignStatus: {
3339
- error: string;
3340
- details: import("database/api/.generated/runtime/library").JsonValue;
3341
- status: import("../database/api/.generated").$Enums.RunStatus;
3342
- campaignId: string;
3343
- computedUntil: bigint;
3344
- processingStarted: bigint;
3345
- }[];
3346
- Opportunity: {
3347
- name: string;
3348
- id: string;
3349
- };
3350
3339
  computeChainId: number;
3351
3340
  distributionChainId: number;
3352
3341
  campaignId: string;
@@ -3355,6 +3344,18 @@ declare const app: Elysia<"", false, {
3355
3344
  address: string;
3356
3345
  isTest: boolean;
3357
3346
  };
3347
+ Opportunity: {
3348
+ name: string;
3349
+ id: string;
3350
+ };
3351
+ CampaignStatus: {
3352
+ error: string;
3353
+ details: import("database/api/.generated/runtime/library").JsonValue;
3354
+ status: import("../database/api/.generated").$Enums.RunStatus;
3355
+ campaignId: string;
3356
+ computedUntil: bigint;
3357
+ processingStarted: bigint;
3358
+ }[];
3358
3359
  }[];
3359
3360
  };
3360
3361
  };
@@ -3403,7 +3404,7 @@ declare const app: Elysia<"", false, {
3403
3404
  };
3404
3405
  headers: unknown;
3405
3406
  response: {
3406
- 200: import("./modules/v4/liquidity").PositionT[];
3407
+ 200: import("./modules/v4/liquidity/liquidity.model").PositionT[];
3407
3408
  };
3408
3409
  };
3409
3410
  };
@@ -3424,7 +3425,7 @@ declare const app: Elysia<"", false, {
3424
3425
  headers: unknown;
3425
3426
  response: {
3426
3427
  200: (import("./modules/v4/claims").ClaimModel & {
3427
- token?: import("./modules/v4").Token["model"];
3428
+ token?: import("./modules/v4/token").Token["model"];
3428
3429
  })[];
3429
3430
  };
3430
3431
  };
@@ -3861,8 +3862,8 @@ declare const app: Elysia<"", false, {
3861
3862
  body: {
3862
3863
  reason: string;
3863
3864
  value: number;
3864
- address: string;
3865
3865
  campaignId: string;
3866
+ address: string;
3866
3867
  field: string;
3867
3868
  }[];
3868
3869
  params: {};
@@ -4377,9 +4378,9 @@ declare const app: Elysia<"", false, {
4377
4378
  type?: undefined;
4378
4379
  tag?: string | undefined;
4379
4380
  chainId?: undefined;
4380
- mainParameter?: string | undefined;
4381
4381
  action?: undefined;
4382
4382
  campaigns?: boolean | undefined;
4383
+ mainParameter?: string | undefined;
4383
4384
  testTokens?: boolean | undefined;
4384
4385
  };
4385
4386
  headers: unknown;
@@ -4573,8 +4574,8 @@ declare const app: Elysia<"", false, {
4573
4574
  pending?: string | undefined;
4574
4575
  symbol: string;
4575
4576
  token: string;
4576
- mainParameter: string;
4577
4577
  decimals: number;
4578
+ mainParameter: string;
4578
4579
  unclaimed: string;
4579
4580
  accumulated: string;
4580
4581
  };
@@ -4604,8 +4605,8 @@ declare const app: Elysia<"", false, {
4604
4605
  params: {};
4605
4606
  query: {
4606
4607
  from?: number | undefined;
4607
- to?: number | undefined;
4608
4608
  mainParameter?: string | undefined;
4609
+ to?: number | undefined;
4609
4610
  chainId: number;
4610
4611
  campaignId: string;
4611
4612
  };
@@ -4708,9 +4709,9 @@ declare const app: Elysia<"", false, {
4708
4709
  body: unknown;
4709
4710
  params: {};
4710
4711
  query: {
4711
- mainParameter?: string | undefined;
4712
4712
  rewardToken?: string | undefined;
4713
4713
  proof?: string | undefined;
4714
+ mainParameter?: string | undefined;
4714
4715
  reloadChainId?: number | undefined;
4715
4716
  chainId: never;
4716
4717
  user: string;
@@ -56,6 +56,14 @@ export class BalancerV3PoolProcessor extends GenericProcessor {
56
56
  delete typeInfo[key];
57
57
  }
58
58
  }
59
+ const symbols = [];
60
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
61
+ let symbolToClean = typeInfo[`symbolToken${i}`];
62
+ symbolToClean = symbolToClean.replace("sc", "");
63
+ symbolToClean = symbolToClean.replace("wmooSiloV2Sonic", "");
64
+ symbolToClean = symbolToClean.replace(" (wS Market)", "");
65
+ symbols.push(symbolToClean);
66
+ }
59
67
  return {
60
68
  ...typeInfo,
61
69
  totalSupply,
@@ -63,7 +71,7 @@ export class BalancerV3PoolProcessor extends GenericProcessor {
63
71
  whitelistedSupplyTargetToken,
64
72
  blacklistedSupply,
65
73
  priceTargetToken,
66
- cardName: generateCardName(type, typeInfo, campaign),
74
+ cardName: generateCardName(type, typeInfo, campaign, symbols),
67
75
  };
68
76
  }
69
77
  }
@@ -14,14 +14,4 @@ export interface Token {
14
14
  export interface TokenInfoListType {
15
15
  [symbol: string]: Token;
16
16
  }
17
- export interface TokenList {
18
- [chainId: number]: TokenInfoListType;
19
- }
20
17
  export declare const getTokensListWithCache: () => Promise<TokenList>;
21
- export type MerklTokens = {
22
- [address: string]: {
23
- symbol: string;
24
- decimals: number;
25
- };
26
- };
27
- export declare function getMerklTokenList(chainId: number): Promise<MerklTokens>;
@@ -1,5 +1,4 @@
1
1
  import { Redis } from "../cache";
2
- import { engineDbClient } from "../utils/prisma";
3
2
  import axios from "axios";
4
3
  import { log } from "../utils/logger";
5
4
  async function getTokensList() {
@@ -14,24 +13,5 @@ async function getTokensList() {
14
13
  }
15
14
  return res;
16
15
  }
16
+ // Deprecated
17
17
  export const getTokensListWithCache = async () => await Redis.getOrSet("TokenList", getTokensList);
18
- export async function getMerklTokenList(chainId) {
19
- const tokensRaws = await engineDbClient.tokens.findMany({
20
- select: {
21
- address: true,
22
- decimals: true,
23
- symbol: true,
24
- },
25
- where: {
26
- chainId,
27
- },
28
- });
29
- const tokens = {};
30
- for (const token of tokensRaws) {
31
- tokens[token.address] = {
32
- decimals: token.decimals,
33
- symbol: token.symbol,
34
- };
35
- }
36
- return tokens;
37
- }
@@ -1,8 +1,8 @@
1
1
  import { Redis } from "../cache";
2
+ import { TokenService } from "../modules/v4/token";
2
3
  import { Interface } from "@ethersproject/abi";
3
4
  import { BN2Number, DistributionCreator__factory, Distributor__factory, NETWORK_LABELS, NULL_ADDRESS, registry, } from "@sdk";
4
5
  import { batchMulticallCallWithRetry } from "../utils/generic";
5
- import { getMerklTokenList, getTokensListWithCache } from "./getTokensList";
6
6
  const DistributorInterface = Distributor__factory.createInterface();
7
7
  const DistributorCreatorInterface = DistributionCreator__factory.createInterface();
8
8
  const MTW_INTERFACE = new Interface([
@@ -10,7 +10,7 @@ const MTW_INTERFACE = new Interface([
10
10
  "function token() external view returns (address)",
11
11
  ]);
12
12
  export async function merklChainData(chainId) {
13
- const tokens = await getMerklTokenList(chainId);
13
+ const tokens = await TokenService.findManyObjectPerAddress({ chainId, verified: true });
14
14
  const distributorAddress = registry(chainId)?.Merkl?.Distributor;
15
15
  const distributionCreatorAddress = registry(chainId)?.Merkl?.DistributionCreator;
16
16
  if (!distributorAddress || !distributionCreatorAddress) {
@@ -54,7 +54,6 @@ export async function merklChainData(chainId) {
54
54
  },
55
55
  ];
56
56
  const result = await batchMulticallCallWithRetry(chainId, { calls });
57
- const tokenList = await getTokensListWithCache();
58
57
  let i = 0;
59
58
  const merkleRoot = DistributorInterface.decodeFunctionResult("getMerkleRoot", result[i++].returnData)[0]?.toString();
60
59
  const treeRoot = DistributorInterface.decodeFunctionResult("tree", result[i++].returnData)[0].toString();
@@ -67,16 +66,8 @@ export async function merklChainData(chainId) {
67
66
  }
68
67
  catch { }
69
68
  const validRewardTokens = DistributorCreatorInterface.decodeFunctionResult("getValidRewardTokens()", result[i++].returnData)[0].map((t) => {
70
- const decimals = tokens[t.token]?.decimals
71
- ? tokens[t.token]?.decimals
72
- : tokenList[chainId]?.[t.token]?.decimals
73
- ? tokenList[chainId][t.token].decimals
74
- : undefined;
75
- const symbol = tokens[t.token]?.symbol
76
- ? tokens[t.token]?.symbol
77
- : tokenList[chainId]?.[t.token]?.symbol
78
- ? tokenList[chainId][t.token].symbol
79
- : undefined;
69
+ const decimals = tokens[t.token]?.decimals ? tokens[t.token]?.decimals : undefined;
70
+ const symbol = tokens[t.token]?.symbol ? tokens[t.token]?.symbol : undefined;
80
71
  return {
81
72
  decimals: decimals,
82
73
  minimumAmountPerEpoch: decimals
@@ -86,17 +77,6 @@ export async function merklChainData(chainId) {
86
77
  token: t.token,
87
78
  };
88
79
  });
89
- const missingSymbols = validRewardTokens.filter(t => !t.symbol || !t.decimals);
90
- for (const token of missingSymbols) {
91
- if (!tokenList[chainId])
92
- continue;
93
- const tokenInfo = tokenList[chainId][token.token];
94
- if (!tokenInfo)
95
- continue;
96
- token.symbol = tokenInfo.symbol;
97
- token.decimals = tokenInfo.decimals;
98
- token.minimumAmountPerEpoch = BN2Number(token.minimumAmountPerEpoch, tokenInfo.decimals);
99
- }
100
80
  const validRewardTokensCalls = validRewardTokens.reduce((acc, t) => {
101
81
  acc.push({
102
82
  allowFailure: true,
@@ -1,6 +1,6 @@
1
+ import { TokenService } from "../../modules/v4/token";
1
2
  import { ChainId, ChainInteractionService, ETH_ADDRESS, ETH_ZKSYNC_ADDRESS, Erc20__factory, EthOnZKSync_INTERFACE, NETWORK_LABELS, } from "@sdk";
2
3
  import { log } from "../../utils/logger";
3
- import { getTokensListWithCache } from "../getTokensList";
4
4
  export async function getOnlyUserBalance(chainId, userAddress, tokenAddresses) {
5
5
  const calls = [];
6
6
  const ERC20_Interface = Erc20__factory.createInterface();
@@ -40,7 +40,7 @@ export async function getOnlyUserBalance(chainId, userAddress, tokenAddresses) {
40
40
  return res;
41
41
  }
42
42
  export async function getUserBalances(user, chainId, tokenAddresses) {
43
- const tokens = (await getTokensListWithCache())?.[chainId];
43
+ const tokens = await TokenService.findManyObjectPerAddress({ chainId, verified: true });
44
44
  if (!tokens) {
45
45
  log.debug("❌ Chain not supported");
46
46
  return {
@@ -29,13 +29,13 @@ export declare const AccountingController: Elysia<"/accounting", false, {
29
29
  id: string;
30
30
  timestamp: number;
31
31
  chainId: number;
32
+ datetime: Date;
33
+ recipient: string;
32
34
  fromTokenId: string;
33
35
  toTokenId: string;
34
36
  multisig: string;
35
- recipient: string;
36
37
  amountIn: string;
37
38
  amountOut: string;
38
- datetime: Date;
39
39
  }[];
40
40
  };
41
41
  };
@@ -4,96 +4,96 @@ export declare class AccountingRepository {
4
4
  id: string;
5
5
  timestamp: number;
6
6
  chainId: number;
7
+ datetime: Date;
8
+ recipient: string;
7
9
  fromTokenId: string;
8
10
  toTokenId: string;
9
11
  multisig: string;
10
- recipient: string;
11
12
  amountIn: string;
12
13
  amountOut: string;
13
- datetime: Date;
14
14
  }[]>;
15
15
  static getByTokenForDumper(fromTokenId: string): Promise<{
16
16
  id: string;
17
17
  timestamp: number;
18
18
  chainId: number;
19
+ datetime: Date;
20
+ recipient: string;
19
21
  fromTokenId: string;
20
22
  toTokenId: string;
21
23
  multisig: string;
22
- recipient: string;
23
24
  amountIn: string;
24
25
  amountOut: string;
25
- datetime: Date;
26
26
  }[]>;
27
27
  static getForMonthForRecipient(recipient: string, toTokenId: string, month: number, year: number): Promise<{
28
28
  id: string;
29
29
  timestamp: number;
30
30
  chainId: number;
31
+ datetime: Date;
32
+ recipient: string;
31
33
  fromTokenId: string;
32
34
  toTokenId: string;
33
35
  multisig: string;
34
- recipient: string;
35
36
  amountIn: string;
36
37
  amountOut: string;
37
- datetime: Date;
38
38
  }[]>;
39
39
  static getForMultisigBetweenDates(startDate: Date, endDate: Date): Promise<{
40
40
  id: string;
41
41
  timestamp: number;
42
42
  chainId: number;
43
+ datetime: Date;
44
+ recipient: string;
43
45
  fromTokenId: string;
44
46
  toTokenId: string;
45
47
  multisig: string;
46
- recipient: string;
47
48
  amountIn: string;
48
49
  amountOut: string;
49
- datetime: Date;
50
50
  }[]>;
51
51
  static getForMultisig(): Promise<{
52
52
  id: string;
53
53
  timestamp: number;
54
54
  chainId: number;
55
+ datetime: Date;
56
+ recipient: string;
55
57
  fromTokenId: string;
56
58
  toTokenId: string;
57
59
  multisig: string;
58
- recipient: string;
59
60
  amountIn: string;
60
61
  amountOut: string;
61
- datetime: Date;
62
62
  }[]>;
63
63
  static getForMultisigByChain(chainId: number): Promise<{
64
64
  id: string;
65
65
  timestamp: number;
66
66
  chainId: number;
67
+ datetime: Date;
68
+ recipient: string;
67
69
  fromTokenId: string;
68
70
  toTokenId: string;
69
71
  multisig: string;
70
- recipient: string;
71
72
  amountIn: string;
72
73
  amountOut: string;
73
- datetime: Date;
74
74
  }[]>;
75
75
  static getForMultisigByChainBetweenDates(chainId: number, startDate: Date, endDate: Date): Promise<{
76
76
  id: string;
77
77
  timestamp: number;
78
78
  chainId: number;
79
+ datetime: Date;
80
+ recipient: string;
79
81
  fromTokenId: string;
80
82
  toTokenId: string;
81
83
  multisig: string;
82
- recipient: string;
83
84
  amountIn: string;
84
85
  amountOut: string;
85
- datetime: Date;
86
86
  }[]>;
87
87
  static getForDumperBetweenDates(fromTokenId: string, startDate: Date, endDate: Date): Promise<{
88
88
  id: string;
89
89
  timestamp: number;
90
90
  chainId: number;
91
+ datetime: Date;
92
+ recipient: string;
91
93
  fromTokenId: string;
92
94
  toTokenId: string;
93
95
  multisig: string;
94
- recipient: string;
95
96
  amountIn: string;
96
97
  amountOut: string;
97
- datetime: Date;
98
98
  }[]>;
99
99
  }
@@ -7,13 +7,13 @@ export declare class AccountingService {
7
7
  id: string;
8
8
  timestamp: number;
9
9
  chainId: number;
10
+ datetime: Date;
11
+ recipient: string;
10
12
  fromTokenId: string;
11
13
  toTokenId: string;
12
14
  multisig: string;
13
- recipient: string;
14
15
  amountIn: string;
15
16
  amountOut: string;
16
- datetime: Date;
17
17
  }[]>;
18
18
  static getRevenue(): Promise<{
19
19
  totalAmount: number;
@@ -7,11 +7,15 @@ export class BoostService {
7
7
  const protocol = query.protocol;
8
8
  const target = query.target;
9
9
  const url = `https://www.data-openblocklabs.com/zksync/boosts/${protocol}/${target}`;
10
- return (await axios.post(url, body, {
10
+ const response = await axios.post(url, body, {
11
11
  headers: {
12
12
  "Content-Type": "application/json",
13
13
  },
14
- })).data.map(({ address, boost }) => ({ address, boost: boost.toString() }));
14
+ });
15
+ if (response.data.length === 0) {
16
+ throw new Error("No data found");
17
+ }
18
+ return response.data.map(({ address, boost }) => ({ address, boost: boost.toString() }));
15
19
  }
16
20
  static async getOpenBlockBoostDefault() {
17
21
  return [