@merkl/api 0.16.13 → 0.16.15

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 (51) hide show
  1. package/dist/src/backgroundJobs/jobs/priceUpdater.js +1 -1
  2. package/dist/src/eden/index.d.ts +363 -413
  3. package/dist/src/entities/opportunity.js +17 -0
  4. package/dist/src/index.d.ts +84 -82
  5. package/dist/src/libs/campaigns/campaignTypes/EncompassingDynamicData.d.ts +5 -0
  6. package/dist/src/libs/campaigns/campaignTypes/EncompassingDynamicData.js +34 -0
  7. package/dist/src/libs/campaigns/campaignsDynamicData.js +4 -0
  8. package/dist/src/libs/merklChainData.js +1 -1
  9. package/dist/src/libs/tokens/balances.js +1 -1
  10. package/dist/src/modules/v4/accounting/accounting.service.js +1 -1
  11. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +1 -13
  12. package/dist/src/modules/v4/campaign/campaign.repository.js +2 -2
  13. package/dist/src/modules/v4/campaign/campaign.service.d.ts +2 -26
  14. package/dist/src/modules/v4/campaign/campaign.service.js +3 -3
  15. package/dist/src/modules/v4/claims/claims.controller.d.ts +1 -1
  16. package/dist/src/modules/v4/enso/enso.model.d.ts +1 -1
  17. package/dist/src/modules/v4/enso/enso.model.js +1 -1
  18. package/dist/src/modules/v4/enso/enso.service.d.ts +2 -2
  19. package/dist/src/modules/v4/enso/enso.service.js +2 -2
  20. package/dist/src/modules/v4/interaction/interaction.model.d.ts +1 -1
  21. package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +1 -1
  22. package/dist/src/modules/v4/kyberzap/kyberzap.service.js +1 -1
  23. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +4 -40
  24. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +12 -108
  25. package/dist/src/modules/v4/opportunity/opportunity.service.js +8 -5
  26. package/dist/src/modules/v4/opportunity/subservices/getAjnaMetadata.service.js +1 -1
  27. package/dist/src/modules/v4/opportunity/subservices/getBadgerMetadata.service.js +1 -1
  28. package/dist/src/modules/v4/opportunity/subservices/getEncompassingMetadata.service.d.ts +3 -0
  29. package/dist/src/modules/v4/opportunity/subservices/getEncompassingMetadata.service.js +35 -0
  30. package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
  31. package/dist/src/modules/v4/protocol/protocol.model.js +4 -0
  32. package/dist/src/modules/v4/protocol/protocol.service.js +6 -2
  33. package/dist/src/modules/v4/referral/referral.controller.d.ts +82 -0
  34. package/dist/src/modules/v4/referral/referral.controller.js +25 -0
  35. package/dist/src/modules/v4/referral/referral.model.d.ts +10 -0
  36. package/dist/src/modules/v4/referral/referral.model.js +12 -0
  37. package/dist/src/modules/v4/referral/referral.service.d.ts +216 -0
  38. package/dist/src/modules/v4/referral/referral.service.js +170 -0
  39. package/dist/src/modules/v4/reward/reward.controller.js +3 -3
  40. package/dist/src/modules/v4/reward/reward.repository.js +2 -2
  41. package/dist/src/modules/v4/reward/reward.service.js +1 -1
  42. package/dist/src/modules/v4/router.d.ts +84 -82
  43. package/dist/src/modules/v4/router.js +3 -1
  44. package/dist/src/modules/v4/token/token.controller.d.ts +16 -28
  45. package/dist/src/modules/v4/token/token.controller.js +2 -1
  46. package/dist/src/modules/v4/token/token.service.d.ts +5 -69
  47. package/dist/src/routes/v3/lostyield.js +1 -1
  48. package/dist/tsconfig.package.tsbuildinfo +1 -1
  49. package/package.json +1 -1
  50. package/dist/src/modules/v4/token/index.d.ts +0 -3
  51. package/dist/src/modules/v4/token/index.js +0 -3
@@ -120,21 +120,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
120
120
  };
121
121
  headers: unknown;
122
122
  response: {
123
- 200: ({
124
- symbol: string;
125
- name: string | null;
126
- id: string;
127
- icon: string;
128
- chainId: number;
129
- address: string;
130
- decimals: number;
131
- verified: boolean;
132
- isTest: boolean;
133
- } & {
134
- price?: number | null | undefined;
135
- } & {
136
- balance: bigint;
137
- })[];
123
+ 200: any[];
138
124
  };
139
125
  };
140
126
  };
@@ -156,19 +142,7 @@ export declare const TokenController: Elysia<"/tokens", false, {
156
142
  };
157
143
  headers: unknown;
158
144
  response: {
159
- 200: ({
160
- symbol: string;
161
- name: string | null;
162
- id: string;
163
- icon: string;
164
- chainId: number;
165
- address: string;
166
- decimals: number;
167
- verified: boolean;
168
- isTest: boolean;
169
- } & {
170
- price?: number | null | undefined;
171
- })[];
145
+ 200: Token[];
172
146
  };
173
147
  };
174
148
  };
@@ -262,6 +236,20 @@ export declare const TokenController: Elysia<"/tokens", false, {
262
236
  };
263
237
  };
264
238
  };
239
+ } & {
240
+ tokens: {
241
+ sync: {
242
+ get: {
243
+ body: unknown;
244
+ params: {};
245
+ query: unknown;
246
+ headers: unknown;
247
+ response: {
248
+ 200: void;
249
+ };
250
+ };
251
+ };
252
+ };
265
253
  }, {
266
254
  derive: {};
267
255
  resolve: {};
@@ -66,4 +66,5 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
66
66
  headers: AuthorizationHeadersDto,
67
67
  beforeHandle: BackOfficeGuard,
68
68
  detail: { hide: true },
69
- });
69
+ })
70
+ .get("/sync", async () => await TokenService.fillTokenAndIconsFromTokenList(), { detail: { hide: true } });
@@ -14,56 +14,16 @@ export declare abstract class TokenService {
14
14
  /**
15
15
  * Fetches tokens and include balances
16
16
  */
17
- static fetchTokensAndBalances(chainId: number, userAddress: string, addresses: string[]): Promise<({
18
- symbol: string;
19
- name: string | null;
20
- id: string;
21
- icon: string;
22
- chainId: number;
23
- address: string;
24
- decimals: number;
25
- verified: boolean;
26
- isTest: boolean;
27
- } & {
28
- price?: number | null | undefined;
29
- } & {
30
- balance: bigint;
31
- })[]>;
17
+ static fetchTokensAndBalances(chainId: number, userAddress: string, addresses: string[]): Promise<any[]>;
32
18
  /**
33
19
  * Fetches balances of verified tokens
34
20
  * @info tokens that are popular and must be detected in the app are marked as 'verified'
35
21
  * @param additionalTokens balances along with the verified ones
36
22
  */
37
- static fetchVerifiedBalances(chainId: number, userAddress: string, additionalTokenAddresses?: string[]): Promise<({
38
- symbol: string;
39
- name: string | null;
40
- id: string;
41
- icon: string;
42
- chainId: number;
43
- address: string;
44
- decimals: number;
45
- verified: boolean;
46
- isTest: boolean;
47
- } & {
48
- price?: number | null | undefined;
49
- } & {
50
- balance: bigint;
51
- })[]>;
23
+ static fetchVerifiedBalances(chainId: number, userAddress: string, additionalTokenAddresses?: string[]): Promise<any[]>;
52
24
  static fetchOnChain(token: TokenModel): Promise<Omit<Token["model"], "id">>;
53
25
  static fetchManyOnChain(chainId: ChainId, addresses: string[]): Promise<{
54
- [address: string]: Omit<{
55
- symbol: string;
56
- name: string | null;
57
- id: string;
58
- icon: string;
59
- chainId: number;
60
- address: string;
61
- decimals: number;
62
- verified: boolean;
63
- isTest: boolean;
64
- } & {
65
- price?: number | null | undefined;
66
- }, "id">;
26
+ [address: string]: Omit<Token, "id">;
67
27
  }>;
68
28
  /**
69
29
  * Updates price of tokens that share the same symbol
@@ -150,32 +110,8 @@ export declare abstract class TokenService {
150
110
  * @param query
151
111
  * @returns A list of tokens
152
112
  */
153
- static findMany(query: GetTokenQueryModel): Promise<({
154
- symbol: string;
155
- name: string | null;
156
- id: string;
157
- icon: string;
158
- chainId: number;
159
- address: string;
160
- decimals: number;
161
- verified: boolean;
162
- isTest: boolean;
163
- } & {
164
- price?: number | null | undefined;
165
- })[]>;
166
- static findManyObjectPerAddress(query: GetTokenQueryModel): Promise<Record<string, {
167
- symbol: string;
168
- name: string | null;
169
- id: string;
170
- icon: string;
171
- chainId: number;
172
- address: string;
173
- decimals: number;
174
- verified: boolean;
175
- isTest: boolean;
176
- } & {
177
- price?: number | null | undefined;
178
- }>>;
113
+ static findMany(query: GetTokenQueryModel): Promise<Token[]>;
114
+ static findManyObjectPerAddress(query: GetTokenQueryModel): Promise<Token>;
179
115
  /**
180
116
  * Get value of tokens
181
117
  * @param tokenAmounts address/chain + amount of token
@@ -1,5 +1,5 @@
1
1
  import { Redis } from "../../cache";
2
- import { TokenService } from "../../modules/v4/token";
2
+ import { TokenService } from "../../modules/v4/token/token.service";
3
3
  import { getLastBlockBeforeWithCache } from "../../utils/lastBlockBefore";
4
4
  import { BN2Number, ChainId, DAY, ERC20Interface } from "@sdk";
5
5
  import { t } from "elysia";