@merkl/api 0.16.5 → 0.16.7
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.
- package/dist/src/backgroundJobs/jobs/campaignsCacheUpdater.js +3 -1
- package/dist/src/backgroundJobs/jobs/priceUpdater.js +1 -1
- package/dist/src/constants.d.ts +259 -13
- package/dist/src/eden/index.d.ts +15 -10
- package/dist/src/index.d.ts +3 -2
- package/dist/src/libs/campaigns/campaignTypes/UniswapV4DynamicData.js +2 -1
- package/dist/src/libs/getTokensList.d.ts +0 -10
- package/dist/src/libs/getTokensList.js +1 -21
- package/dist/src/libs/merklChainData.js +4 -24
- package/dist/src/libs/tokens/balances.js +2 -2
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +1 -1
- package/dist/src/modules/v4/campaign/campaign.model.js +1 -1
- package/dist/src/modules/v4/claims/claims.controller.d.ts +1 -1
- package/dist/src/modules/v4/reward/reward.model.d.ts +1 -1
- package/dist/src/modules/v4/reward/reward.model.js +1 -1
- package/dist/src/modules/v4/router.d.ts +1 -0
- package/dist/src/modules/v4/token/token.controller.d.ts +1 -0
- package/dist/src/modules/v4/token/token.model.d.ts +1 -0
- package/dist/src/modules/v4/token/token.model.js +1 -0
- package/dist/src/modules/v4/token/token.service.d.ts +13 -0
- package/dist/src/modules/v4/token/token.service.js +6 -17
- package/dist/src/modules/v4/user/user.controller.d.ts +1 -1
- package/dist/src/routes/v3/lostyield.js +6 -3
- package/dist/src/utils/prices/priceService.js +1 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/modules/v4/index.d.ts +0 -4
- package/dist/src/modules/v4/index.js +0 -4
@@ -1,8 +1,10 @@
|
|
1
1
|
import { Redis } from "../../cache";
|
2
2
|
import { campaignsToOldFormat } from "../../libs/deprecated-merklv3";
|
3
|
-
import { AprService
|
3
|
+
import { AprService } from "../../modules/v4/apr";
|
4
4
|
import { CacheService } from "../../modules/v4/cache";
|
5
5
|
import { TTLPresets } from "../../modules/v4/cache/cache.model";
|
6
|
+
import { CampaignService } from "../../modules/v4/campaign";
|
7
|
+
import { OpportunityService } from "../../modules/v4/opportunity";
|
6
8
|
import { OpportunityRepository } from "../../modules/v4/opportunity/opportunity.repository";
|
7
9
|
import { RewardService } from "../../modules/v4/reward";
|
8
10
|
import { TvlService } from "../../modules/v4/tvl";
|
package/dist/src/constants.d.ts
CHANGED
@@ -31,7 +31,7 @@ export declare const DOPEX_OPTION_MARKET: {
|
|
31
31
|
[market: string]: string;
|
32
32
|
};
|
33
33
|
export declare const constantChain: {
|
34
|
-
[
|
34
|
+
[x: number]: {
|
35
35
|
apw: string;
|
36
36
|
convexEndpoint: string;
|
37
37
|
crv: string;
|
@@ -55,8 +55,28 @@ export declare const constantChain: {
|
|
55
55
|
usdc: string;
|
56
56
|
weth: string;
|
57
57
|
wstETH: string;
|
58
|
-
|
59
|
-
|
58
|
+
arb?: undefined;
|
59
|
+
chr?: undefined;
|
60
|
+
convexProxy?: undefined;
|
61
|
+
crv2Pool?: undefined;
|
62
|
+
jeur?: undefined;
|
63
|
+
ram?: undefined;
|
64
|
+
sliz?: undefined;
|
65
|
+
mai?: undefined;
|
66
|
+
op?: undefined;
|
67
|
+
usdce?: undefined;
|
68
|
+
velo?: undefined;
|
69
|
+
veloV2?: undefined;
|
70
|
+
aero?: undefined;
|
71
|
+
am3CRV?: undefined;
|
72
|
+
amDAI?: undefined;
|
73
|
+
amUSDC?: undefined;
|
74
|
+
amUSDT?: undefined;
|
75
|
+
jrt?: undefined;
|
76
|
+
oretro?: undefined;
|
77
|
+
glcr?: undefined;
|
78
|
+
cake?: undefined;
|
79
|
+
} | {
|
60
80
|
arb: string;
|
61
81
|
chr: string;
|
62
82
|
convexProxy: string;
|
@@ -70,8 +90,38 @@ export declare const constantChain: {
|
|
70
90
|
sliz: string;
|
71
91
|
stakeEndpoint: string;
|
72
92
|
usdc: string;
|
73
|
-
|
74
|
-
|
93
|
+
apw?: undefined;
|
94
|
+
convexEndpoint?: undefined;
|
95
|
+
crv3?: undefined;
|
96
|
+
crvANGLESDANGLE?: undefined;
|
97
|
+
crvEURAEUROC?: undefined;
|
98
|
+
crvEURAEURe?: undefined;
|
99
|
+
crvEuropool?: undefined;
|
100
|
+
crvFRAX?: undefined;
|
101
|
+
crvFRAXEURA?: undefined;
|
102
|
+
crvLUSD3CRV?: undefined;
|
103
|
+
dai?: undefined;
|
104
|
+
fxs?: undefined;
|
105
|
+
morpho?: undefined;
|
106
|
+
rKP3R?: undefined;
|
107
|
+
sushi?: undefined;
|
108
|
+
weth?: undefined;
|
109
|
+
wstETH?: undefined;
|
110
|
+
mai?: undefined;
|
111
|
+
op?: undefined;
|
112
|
+
usdce?: undefined;
|
113
|
+
velo?: undefined;
|
114
|
+
veloV2?: undefined;
|
115
|
+
aero?: undefined;
|
116
|
+
am3CRV?: undefined;
|
117
|
+
amDAI?: undefined;
|
118
|
+
amUSDC?: undefined;
|
119
|
+
amUSDT?: undefined;
|
120
|
+
jrt?: undefined;
|
121
|
+
oretro?: undefined;
|
122
|
+
glcr?: undefined;
|
123
|
+
cake?: undefined;
|
124
|
+
} | {
|
75
125
|
jeur: string;
|
76
126
|
mai: string;
|
77
127
|
op: string;
|
@@ -79,12 +129,89 @@ export declare const constantChain: {
|
|
79
129
|
usdce: string;
|
80
130
|
velo: string;
|
81
131
|
veloV2: string;
|
82
|
-
|
83
|
-
|
132
|
+
apw?: undefined;
|
133
|
+
convexEndpoint?: undefined;
|
134
|
+
crv?: undefined;
|
135
|
+
crv3?: undefined;
|
136
|
+
crvANGLESDANGLE?: undefined;
|
137
|
+
crvEURAEUROC?: undefined;
|
138
|
+
crvEURAEURe?: undefined;
|
139
|
+
crvEuropool?: undefined;
|
140
|
+
crvFRAX?: undefined;
|
141
|
+
crvFRAXEURA?: undefined;
|
142
|
+
crvLUSD3CRV?: undefined;
|
143
|
+
cvx?: undefined;
|
144
|
+
dai?: undefined;
|
145
|
+
frax?: undefined;
|
146
|
+
fxs?: undefined;
|
147
|
+
morpho?: undefined;
|
148
|
+
rKP3R?: undefined;
|
149
|
+
sdt?: undefined;
|
150
|
+
stakeEndpoint?: undefined;
|
151
|
+
sushi?: undefined;
|
152
|
+
weth?: undefined;
|
153
|
+
wstETH?: undefined;
|
154
|
+
arb?: undefined;
|
155
|
+
chr?: undefined;
|
156
|
+
convexProxy?: undefined;
|
157
|
+
crv2Pool?: undefined;
|
158
|
+
ram?: undefined;
|
159
|
+
sliz?: undefined;
|
160
|
+
aero?: undefined;
|
161
|
+
am3CRV?: undefined;
|
162
|
+
amDAI?: undefined;
|
163
|
+
amUSDC?: undefined;
|
164
|
+
amUSDT?: undefined;
|
165
|
+
jrt?: undefined;
|
166
|
+
oretro?: undefined;
|
167
|
+
glcr?: undefined;
|
168
|
+
cake?: undefined;
|
169
|
+
} | {
|
84
170
|
aero: string;
|
85
171
|
usdc: string;
|
86
|
-
|
87
|
-
|
172
|
+
apw?: undefined;
|
173
|
+
convexEndpoint?: undefined;
|
174
|
+
crv?: undefined;
|
175
|
+
crv3?: undefined;
|
176
|
+
crvANGLESDANGLE?: undefined;
|
177
|
+
crvEURAEUROC?: undefined;
|
178
|
+
crvEURAEURe?: undefined;
|
179
|
+
crvEuropool?: undefined;
|
180
|
+
crvFRAX?: undefined;
|
181
|
+
crvFRAXEURA?: undefined;
|
182
|
+
crvLUSD3CRV?: undefined;
|
183
|
+
cvx?: undefined;
|
184
|
+
dai?: undefined;
|
185
|
+
frax?: undefined;
|
186
|
+
fxs?: undefined;
|
187
|
+
morpho?: undefined;
|
188
|
+
rKP3R?: undefined;
|
189
|
+
sdt?: undefined;
|
190
|
+
stakeEndpoint?: undefined;
|
191
|
+
sushi?: undefined;
|
192
|
+
weth?: undefined;
|
193
|
+
wstETH?: undefined;
|
194
|
+
arb?: undefined;
|
195
|
+
chr?: undefined;
|
196
|
+
convexProxy?: undefined;
|
197
|
+
crv2Pool?: undefined;
|
198
|
+
jeur?: undefined;
|
199
|
+
ram?: undefined;
|
200
|
+
sliz?: undefined;
|
201
|
+
mai?: undefined;
|
202
|
+
op?: undefined;
|
203
|
+
usdce?: undefined;
|
204
|
+
velo?: undefined;
|
205
|
+
veloV2?: undefined;
|
206
|
+
am3CRV?: undefined;
|
207
|
+
amDAI?: undefined;
|
208
|
+
amUSDC?: undefined;
|
209
|
+
amUSDT?: undefined;
|
210
|
+
jrt?: undefined;
|
211
|
+
oretro?: undefined;
|
212
|
+
glcr?: undefined;
|
213
|
+
cake?: undefined;
|
214
|
+
} | {
|
88
215
|
am3CRV: string;
|
89
216
|
amDAI: string;
|
90
217
|
amUSDC: string;
|
@@ -93,13 +220,132 @@ export declare const constantChain: {
|
|
93
220
|
jrt: string;
|
94
221
|
oretro: string;
|
95
222
|
usdc: string;
|
96
|
-
|
97
|
-
|
223
|
+
apw?: undefined;
|
224
|
+
convexEndpoint?: undefined;
|
225
|
+
crv?: undefined;
|
226
|
+
crv3?: undefined;
|
227
|
+
crvANGLESDANGLE?: undefined;
|
228
|
+
crvEURAEUROC?: undefined;
|
229
|
+
crvEURAEURe?: undefined;
|
230
|
+
crvEuropool?: undefined;
|
231
|
+
crvFRAX?: undefined;
|
232
|
+
crvFRAXEURA?: undefined;
|
233
|
+
crvLUSD3CRV?: undefined;
|
234
|
+
cvx?: undefined;
|
235
|
+
dai?: undefined;
|
236
|
+
frax?: undefined;
|
237
|
+
fxs?: undefined;
|
238
|
+
morpho?: undefined;
|
239
|
+
rKP3R?: undefined;
|
240
|
+
sdt?: undefined;
|
241
|
+
stakeEndpoint?: undefined;
|
242
|
+
sushi?: undefined;
|
243
|
+
weth?: undefined;
|
244
|
+
wstETH?: undefined;
|
245
|
+
arb?: undefined;
|
246
|
+
chr?: undefined;
|
247
|
+
convexProxy?: undefined;
|
248
|
+
crv2Pool?: undefined;
|
249
|
+
ram?: undefined;
|
250
|
+
sliz?: undefined;
|
251
|
+
mai?: undefined;
|
252
|
+
op?: undefined;
|
253
|
+
usdce?: undefined;
|
254
|
+
velo?: undefined;
|
255
|
+
veloV2?: undefined;
|
256
|
+
aero?: undefined;
|
257
|
+
glcr?: undefined;
|
258
|
+
cake?: undefined;
|
259
|
+
} | {
|
98
260
|
glcr: string;
|
99
261
|
usdc: string;
|
100
|
-
|
101
|
-
|
262
|
+
apw?: undefined;
|
263
|
+
convexEndpoint?: undefined;
|
264
|
+
crv?: undefined;
|
265
|
+
crv3?: undefined;
|
266
|
+
crvANGLESDANGLE?: undefined;
|
267
|
+
crvEURAEUROC?: undefined;
|
268
|
+
crvEURAEURe?: undefined;
|
269
|
+
crvEuropool?: undefined;
|
270
|
+
crvFRAX?: undefined;
|
271
|
+
crvFRAXEURA?: undefined;
|
272
|
+
crvLUSD3CRV?: undefined;
|
273
|
+
cvx?: undefined;
|
274
|
+
dai?: undefined;
|
275
|
+
frax?: undefined;
|
276
|
+
fxs?: undefined;
|
277
|
+
morpho?: undefined;
|
278
|
+
rKP3R?: undefined;
|
279
|
+
sdt?: undefined;
|
280
|
+
stakeEndpoint?: undefined;
|
281
|
+
sushi?: undefined;
|
282
|
+
weth?: undefined;
|
283
|
+
wstETH?: undefined;
|
284
|
+
arb?: undefined;
|
285
|
+
chr?: undefined;
|
286
|
+
convexProxy?: undefined;
|
287
|
+
crv2Pool?: undefined;
|
288
|
+
jeur?: undefined;
|
289
|
+
ram?: undefined;
|
290
|
+
sliz?: undefined;
|
291
|
+
mai?: undefined;
|
292
|
+
op?: undefined;
|
293
|
+
usdce?: undefined;
|
294
|
+
velo?: undefined;
|
295
|
+
veloV2?: undefined;
|
296
|
+
aero?: undefined;
|
297
|
+
am3CRV?: undefined;
|
298
|
+
amDAI?: undefined;
|
299
|
+
amUSDC?: undefined;
|
300
|
+
amUSDT?: undefined;
|
301
|
+
jrt?: undefined;
|
302
|
+
oretro?: undefined;
|
303
|
+
cake?: undefined;
|
304
|
+
} | {
|
102
305
|
cake: string;
|
306
|
+
apw?: undefined;
|
307
|
+
convexEndpoint?: undefined;
|
308
|
+
crv?: undefined;
|
309
|
+
crv3?: undefined;
|
310
|
+
crvANGLESDANGLE?: undefined;
|
311
|
+
crvEURAEUROC?: undefined;
|
312
|
+
crvEURAEURe?: undefined;
|
313
|
+
crvEuropool?: undefined;
|
314
|
+
crvFRAX?: undefined;
|
315
|
+
crvFRAXEURA?: undefined;
|
316
|
+
crvLUSD3CRV?: undefined;
|
317
|
+
cvx?: undefined;
|
318
|
+
dai?: undefined;
|
319
|
+
frax?: undefined;
|
320
|
+
fxs?: undefined;
|
321
|
+
morpho?: undefined;
|
322
|
+
rKP3R?: undefined;
|
323
|
+
sdt?: undefined;
|
324
|
+
stakeEndpoint?: undefined;
|
325
|
+
sushi?: undefined;
|
326
|
+
usdc?: undefined;
|
327
|
+
weth?: undefined;
|
328
|
+
wstETH?: undefined;
|
329
|
+
arb?: undefined;
|
330
|
+
chr?: undefined;
|
331
|
+
convexProxy?: undefined;
|
332
|
+
crv2Pool?: undefined;
|
333
|
+
jeur?: undefined;
|
334
|
+
ram?: undefined;
|
335
|
+
sliz?: undefined;
|
336
|
+
mai?: undefined;
|
337
|
+
op?: undefined;
|
338
|
+
usdce?: undefined;
|
339
|
+
velo?: undefined;
|
340
|
+
veloV2?: undefined;
|
341
|
+
aero?: undefined;
|
342
|
+
am3CRV?: undefined;
|
343
|
+
amDAI?: undefined;
|
344
|
+
amUSDC?: undefined;
|
345
|
+
amUSDT?: undefined;
|
346
|
+
jrt?: undefined;
|
347
|
+
oretro?: undefined;
|
348
|
+
glcr?: undefined;
|
103
349
|
};
|
104
350
|
};
|
105
351
|
export declare const MAVERICK_ZKSYNC_BP_LENS_ADDRESS = "0xd32CE31CaC98CAC0631764B8286358c0606D87F9";
|
package/dist/src/eden/index.d.ts
CHANGED
@@ -1316,6 +1316,7 @@ declare const eden: {
|
|
1316
1316
|
headers?: Record<string, unknown> | undefined;
|
1317
1317
|
query: {
|
1318
1318
|
tokenAddress?: string | undefined;
|
1319
|
+
verified?: boolean | undefined;
|
1319
1320
|
additionalTokenAddresses?: string[] | undefined;
|
1320
1321
|
chainId: number;
|
1321
1322
|
userAddress: string;
|
@@ -2066,7 +2067,7 @@ declare const eden: {
|
|
2066
2067
|
proofs: string[];
|
2067
2068
|
}, "breakdowns"> & {
|
2068
2069
|
breakdowns: {
|
2069
|
-
opportunity: import("../modules/v4").Opportunity["model"];
|
2070
|
+
opportunity: import("../modules/v4/opportunity").Opportunity["model"];
|
2070
2071
|
claimed: bigint;
|
2071
2072
|
amount: bigint;
|
2072
2073
|
pending: bigint;
|
@@ -2780,7 +2781,7 @@ declare const eden: {
|
|
2780
2781
|
fetch?: RequestInit | undefined;
|
2781
2782
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2782
2783
|
200: (import("../modules/v4/claims").ClaimModel & {
|
2783
|
-
token?: import("../modules/v4").Token["model"];
|
2784
|
+
token?: import("../modules/v4/token").Token["model"];
|
2784
2785
|
})[];
|
2785
2786
|
}>>;
|
2786
2787
|
}) & {};
|
@@ -4427,6 +4428,7 @@ declare const eden: {
|
|
4427
4428
|
headers?: Record<string, unknown> | undefined;
|
4428
4429
|
query: {
|
4429
4430
|
tokenAddress?: string | undefined;
|
4431
|
+
verified?: boolean | undefined;
|
4430
4432
|
additionalTokenAddresses?: string[] | undefined;
|
4431
4433
|
chainId: number;
|
4432
4434
|
userAddress: string;
|
@@ -5177,7 +5179,7 @@ declare const eden: {
|
|
5177
5179
|
proofs: string[];
|
5178
5180
|
}, "breakdowns"> & {
|
5179
5181
|
breakdowns: {
|
5180
|
-
opportunity: import("../modules/v4").Opportunity["model"];
|
5182
|
+
opportunity: import("../modules/v4/opportunity").Opportunity["model"];
|
5181
5183
|
claimed: bigint;
|
5182
5184
|
amount: bigint;
|
5183
5185
|
pending: bigint;
|
@@ -5891,7 +5893,7 @@ declare const eden: {
|
|
5891
5893
|
fetch?: RequestInit | undefined;
|
5892
5894
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
5893
5895
|
200: (import("../modules/v4/claims").ClaimModel & {
|
5894
|
-
token?: import("../modules/v4").Token["model"];
|
5896
|
+
token?: import("../modules/v4/token").Token["model"];
|
5895
5897
|
})[];
|
5896
5898
|
}>>;
|
5897
5899
|
}) & {};
|
@@ -8448,6 +8450,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8448
8450
|
params: {};
|
8449
8451
|
query: {
|
8450
8452
|
tokenAddress?: string | undefined;
|
8453
|
+
verified?: boolean | undefined;
|
8451
8454
|
additionalTokenAddresses?: string[] | undefined;
|
8452
8455
|
chainId: number;
|
8453
8456
|
userAddress: string;
|
@@ -9493,7 +9496,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9493
9496
|
proofs: string[];
|
9494
9497
|
}, "breakdowns"> & {
|
9495
9498
|
breakdowns: {
|
9496
|
-
opportunity: import("../modules/v4").Opportunity["model"];
|
9499
|
+
opportunity: import("../modules/v4/opportunity").Opportunity["model"];
|
9497
9500
|
claimed: bigint;
|
9498
9501
|
amount: bigint;
|
9499
9502
|
pending: bigint;
|
@@ -10344,7 +10347,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
10344
10347
|
headers: unknown;
|
10345
10348
|
response: {
|
10346
10349
|
200: (import("../modules/v4/claims").ClaimModel & {
|
10347
|
-
token?: import("../modules/v4").Token["model"];
|
10350
|
+
token?: import("../modules/v4/token").Token["model"];
|
10348
10351
|
})[];
|
10349
10352
|
};
|
10350
10353
|
};
|
@@ -13000,6 +13003,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13000
13003
|
headers?: Record<string, unknown> | undefined;
|
13001
13004
|
query: {
|
13002
13005
|
tokenAddress?: string | undefined;
|
13006
|
+
verified?: boolean | undefined;
|
13003
13007
|
additionalTokenAddresses?: string[] | undefined;
|
13004
13008
|
chainId: number;
|
13005
13009
|
userAddress: string;
|
@@ -13750,7 +13754,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
13750
13754
|
proofs: string[];
|
13751
13755
|
}, "breakdowns"> & {
|
13752
13756
|
breakdowns: {
|
13753
|
-
opportunity: import("../modules/v4").Opportunity["model"];
|
13757
|
+
opportunity: import("../modules/v4/opportunity").Opportunity["model"];
|
13754
13758
|
claimed: bigint;
|
13755
13759
|
amount: bigint;
|
13756
13760
|
pending: bigint;
|
@@ -14464,7 +14468,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14464
14468
|
fetch?: RequestInit | undefined;
|
14465
14469
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
14466
14470
|
200: (import("../modules/v4/claims").ClaimModel & {
|
14467
|
-
token?: import("../modules/v4").Token["model"];
|
14471
|
+
token?: import("../modules/v4/token").Token["model"];
|
14468
14472
|
})[];
|
14469
14473
|
}>>;
|
14470
14474
|
}) & {};
|
@@ -16111,6 +16115,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
16111
16115
|
headers?: Record<string, unknown> | undefined;
|
16112
16116
|
query: {
|
16113
16117
|
tokenAddress?: string | undefined;
|
16118
|
+
verified?: boolean | undefined;
|
16114
16119
|
additionalTokenAddresses?: string[] | undefined;
|
16115
16120
|
chainId: number;
|
16116
16121
|
userAddress: string;
|
@@ -16861,7 +16866,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
16861
16866
|
proofs: string[];
|
16862
16867
|
}, "breakdowns"> & {
|
16863
16868
|
breakdowns: {
|
16864
|
-
opportunity: import("../modules/v4").Opportunity["model"];
|
16869
|
+
opportunity: import("../modules/v4/opportunity").Opportunity["model"];
|
16865
16870
|
claimed: bigint;
|
16866
16871
|
amount: bigint;
|
16867
16872
|
pending: bigint;
|
@@ -17575,7 +17580,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17575
17580
|
fetch?: RequestInit | undefined;
|
17576
17581
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
17577
17582
|
200: (import("../modules/v4/claims").ClaimModel & {
|
17578
|
-
token?: import("../modules/v4").Token["model"];
|
17583
|
+
token?: import("../modules/v4/token").Token["model"];
|
17579
17584
|
})[];
|
17580
17585
|
}>>;
|
17581
17586
|
}) & {};
|
package/dist/src/index.d.ts
CHANGED
@@ -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;
|
@@ -2573,7 +2574,7 @@ declare const app: Elysia<"", false, {
|
|
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;
|
@@ -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
|
};
|
@@ -42,7 +42,8 @@ async function computeUniV4PoolTVLFromMostRecentStateSave(chainId, poolID, price
|
|
42
42
|
}
|
43
43
|
tvl = amount0 * (priceCurrency0 ?? 0) + amount1 * (priceCurrency1 ?? 0);
|
44
44
|
}
|
45
|
-
catch {
|
45
|
+
catch (e) {
|
46
|
+
console.log(e);
|
46
47
|
log.warn(`merklDynamic data - failed to decode state of pool ${poolID} on ${NETWORK_LABELS[chainId]}`);
|
47
48
|
}
|
48
49
|
return { tvl, amount0, amount1, blockNumber: blockNumber };
|
@@ -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
|
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
|
-
|
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 =
|
43
|
+
const tokens = await TokenService.findManyObjectPerAddress({ chainId, verified: true });
|
44
44
|
if (!tokens) {
|
45
45
|
log.debug("❌ Chain not supported");
|
46
46
|
return {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { Resource } from "../prisma";
|
2
|
-
import { type Token } from "../token";
|
2
|
+
import { type Token } from "../token/token.model";
|
3
3
|
import type { Campaign as CampaignEnum, CampaignParameters } from "@sdk";
|
4
4
|
import { type Chain } from "../chain/chain.model";
|
5
5
|
import { type Status } from "../status/status.model";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { t } from "elysia";
|
2
|
-
import { TokenResourceDto } from "../token";
|
2
|
+
import { TokenResourceDto } from "../token/token.model";
|
3
3
|
// ─── DTOs ────────────────────────────────────────────────────────────────────
|
4
4
|
export const DailyRewardsBreakdownRecordResourceDto = t.Object({
|
5
5
|
id: t.Number(),
|
@@ -1398,6 +1398,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1398
1398
|
params: {};
|
1399
1399
|
query: {
|
1400
1400
|
tokenAddress?: string | undefined;
|
1401
|
+
verified?: boolean | undefined;
|
1401
1402
|
additionalTokenAddresses?: string[] | undefined;
|
1402
1403
|
chainId: number;
|
1403
1404
|
userAddress: string;
|