@merkl/api 0.16.18 → 0.16.20

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 (45) hide show
  1. package/dist/src/backgroundJobs/jobs/campaignsCacheUpdater.js +1 -1
  2. package/dist/src/backgroundJobs/jobs/sync.js +1 -1
  3. package/dist/src/cache/index.d.ts +1 -1
  4. package/dist/src/cache/index.js +2 -2
  5. package/dist/src/eden/index.d.ts +410 -35
  6. package/dist/src/entities/campaign.js +1 -1
  7. package/dist/src/index.d.ts +82 -7
  8. package/dist/src/libs/deprecated-merklv3/index.js +2 -2
  9. package/dist/src/modules/v4/accounting/accounting.controller.js +1 -1
  10. package/dist/src/modules/v4/accounting/accounting.service.d.ts +1 -1
  11. package/dist/src/modules/v4/accounting/accounting.service.js +1 -1
  12. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +13 -1
  13. package/dist/src/modules/v4/campaign/campaign.repository.js +1 -1
  14. package/dist/src/modules/v4/campaign/campaign.service.d.ts +26 -2
  15. package/dist/src/modules/v4/chain/chain.controller.js +1 -1
  16. package/dist/src/modules/v4/chain/chain.repository.d.ts +1 -6
  17. package/dist/src/modules/v4/chain/chain.repository.js +2 -5
  18. package/dist/src/modules/v4/chain/chain.service.d.ts +1 -6
  19. package/dist/src/modules/v4/chain/chain.service.js +2 -5
  20. package/dist/src/modules/v4/enso/enso.service.js +4 -1
  21. package/dist/src/modules/v4/kyberzap/kyberzap.service.js +1 -1
  22. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +40 -4
  23. package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -1
  24. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -2
  25. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +109 -13
  26. package/dist/src/modules/v4/opportunity/opportunity.service.js +1 -1
  27. package/dist/src/modules/v4/opportunity/subservices/getClammMetadata.service.js +3 -3
  28. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +1 -0
  29. package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -0
  30. package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
  31. package/dist/src/modules/v4/protocol/protocol.repository.js +5 -1
  32. package/dist/src/modules/v4/protocol/protocol.service.d.ts +0 -2
  33. package/dist/src/modules/v4/protocol/protocol.service.js +1 -39
  34. package/dist/src/modules/v4/reward/reward.service.js +1 -1
  35. package/dist/src/modules/v4/router.d.ts +82 -7
  36. package/dist/src/modules/v4/token/token.controller.d.ts +28 -2
  37. package/dist/src/modules/v4/token/token.service.d.ts +71 -7
  38. package/dist/src/modules/v4/token/token.service.js +3 -3
  39. package/dist/src/modules/v4/user/user.service.js +1 -1
  40. package/dist/src/routes/v3/multiChainPositions.js +1 -1
  41. package/dist/src/routes/v3/opportunity.js +5 -0
  42. package/dist/src/utils/camelToKebabCase.d.ts +1 -0
  43. package/dist/src/utils/camelToKebabCase.js +3 -0
  44. package/dist/tsconfig.package.tsbuildinfo +1 -1
  45. package/package.json +1 -1
@@ -141,7 +141,7 @@ export const campaignCacheUpdate = async (rawChainId, queryCampaignTypes, highCa
141
141
  }
142
142
  await OpportunityService.updateMetadata(chainId);
143
143
  // ─── Refresh Cache For GET /opportunities ────
144
- await CacheService.set(TTLPresets.MIN_5, OpportunityService.getMany, { items: 50, page: 0 });
144
+ await CacheService.set(TTLPresets.MIN_5, OpportunityService.findMany, { items: 50, page: 0 });
145
145
  log.info(`✅ ${NETWORK_LABELS[chainId]} DB records updated successfully`);
146
146
  }
147
147
  else {
@@ -4,7 +4,7 @@ import { ChainService } from "../../modules/v4/chain";
4
4
  import { log } from "../../utils/logger";
5
5
  import Elysia from "elysia";
6
6
  export const sync = new Elysia({ prefix: "/jobs" }).get("/api/sync-with-engine", async () => {
7
- const chains = await ChainService.getMany({});
7
+ const chains = await ChainService.findMany({});
8
8
  for (const chain of chains) {
9
9
  log.info(`fetching campaigns on ${chain.name} (chainId: ${chain.id})`);
10
10
  const campaignsV3 = await CampaignService.getFromEngineDb(chain.id, 0);
@@ -32,7 +32,7 @@ export declare class Cache {
32
32
  * @param key cache key
33
33
  * @returns the uncompressed (if enabled), parsed and typed data from the cache for all keys
34
34
  */
35
- getMany<T extends CacheKey, Key extends T | NonNullable<CacheArg[T]>>(keys: Key[]): Promise<CacheKeys[T]["returns"][]>;
35
+ findMany<T extends CacheKey, Key extends T | NonNullable<CacheArg[T]>>(keys: Key[]): Promise<CacheKeys[T]["returns"][]>;
36
36
  /**
37
37
  * Get many data from cache with argument
38
38
  * @param key cache key
@@ -98,7 +98,7 @@ export class Cache {
98
98
  * @param key cache key
99
99
  * @returns the uncompressed (if enabled), parsed and typed data from the cache for all keys
100
100
  */
101
- async getMany(keys) {
101
+ async findMany(keys) {
102
102
  const nonLocalKeys = keys.filter(key => !this.isLocallyCached(key)); // Keys not stored locally
103
103
  const cached = !!nonLocalKeys.length ? await this.getManyRaw(nonLocalKeys) : [];
104
104
  const res = keys.map(key => {
@@ -122,7 +122,7 @@ export class Cache {
122
122
  */
123
123
  async getManyWithArgs(key, args) {
124
124
  const actualKeys = args.map(arg => `${key}_${arg}`);
125
- return this.getMany(actualKeys);
125
+ return this.findMany(actualKeys);
126
126
  }
127
127
  /**
128
128
  * Get data from cache or set it using the callback