@merkl/api 0.10.110 → 0.10.112

Sign up to get free protection for your applications and to get access to all the features.
@@ -98,7 +98,7 @@ declare const eden: {
98
98
  query?: Record<string, unknown> | undefined;
99
99
  fetch?: RequestInit | undefined;
100
100
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
101
- 200: {
101
+ 200: ({
102
102
  aprRecord: {
103
103
  cumulated: number;
104
104
  timestamp: bigint;
@@ -168,7 +168,44 @@ declare const eden: {
168
168
  tvl: number;
169
169
  apr: number;
170
170
  dailyRewards: number;
171
- } | null | undefined;
171
+ } & {
172
+ campaigns: ({
173
+ params: any;
174
+ chain: {
175
+ id: number;
176
+ name: string;
177
+ icon: string;
178
+ };
179
+ rewardToken: {
180
+ id: string;
181
+ name: string | null;
182
+ chainId: number;
183
+ address: string;
184
+ decimals: number;
185
+ symbol: string;
186
+ icon: string;
187
+ verified: boolean;
188
+ price: number | null;
189
+ };
190
+ distributionChain: {
191
+ id: number;
192
+ name: string;
193
+ icon: string;
194
+ } | undefined;
195
+ id: string;
196
+ computeChainId: number;
197
+ distributionChainId: number;
198
+ campaignId: string;
199
+ type: import("../../database/api/.generated").$Enums.CampaignType;
200
+ subType: number | null;
201
+ rewardTokenId: string;
202
+ amount: string;
203
+ opportunityId: string;
204
+ startTimestamp: bigint;
205
+ endTimestamp: bigint;
206
+ creatorAddress: string;
207
+ } | null)[];
208
+ }) | null | undefined;
172
209
  }>>;
173
210
  };
174
211
  }) & {
@@ -617,9 +654,9 @@ declare const eden: {
617
654
  headers?: Record<string, unknown> | undefined;
618
655
  query: {
619
656
  items?: number | undefined;
657
+ chainId?: number | undefined;
620
658
  page?: number | undefined;
621
- chainId: number;
622
- campaignId: string;
659
+ campaignId?: string | undefined;
623
660
  };
624
661
  fetch?: RequestInit | undefined;
625
662
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -631,9 +668,9 @@ declare const eden: {
631
668
  headers?: Record<string, unknown> | undefined;
632
669
  query: {
633
670
  items?: number | undefined;
671
+ chainId?: number | undefined;
634
672
  page?: number | undefined;
635
- chainId: number;
636
- campaignId: string;
673
+ campaignId?: string | undefined;
637
674
  };
638
675
  fetch?: RequestInit | undefined;
639
676
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -1810,7 +1847,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
1810
1847
  query: unknown;
1811
1848
  headers: unknown;
1812
1849
  response: {
1813
- 200: {
1850
+ 200: ({
1814
1851
  aprRecord: {
1815
1852
  cumulated: number;
1816
1853
  timestamp: bigint;
@@ -1880,7 +1917,44 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
1880
1917
  tvl: number;
1881
1918
  apr: number;
1882
1919
  dailyRewards: number;
1883
- } | null | undefined;
1920
+ } & {
1921
+ campaigns: ({
1922
+ params: any;
1923
+ chain: {
1924
+ id: number;
1925
+ name: string;
1926
+ icon: string;
1927
+ };
1928
+ rewardToken: {
1929
+ id: string;
1930
+ name: string | null;
1931
+ chainId: number;
1932
+ address: string;
1933
+ decimals: number;
1934
+ symbol: string;
1935
+ icon: string;
1936
+ verified: boolean;
1937
+ price: number | null;
1938
+ };
1939
+ distributionChain: {
1940
+ id: number;
1941
+ name: string;
1942
+ icon: string;
1943
+ } | undefined;
1944
+ id: string;
1945
+ computeChainId: number;
1946
+ distributionChainId: number;
1947
+ campaignId: string;
1948
+ type: import("../../database/api/.generated").$Enums.CampaignType;
1949
+ subType: number | null;
1950
+ rewardTokenId: string;
1951
+ amount: string;
1952
+ opportunityId: string;
1953
+ startTimestamp: bigint;
1954
+ endTimestamp: bigint;
1955
+ creatorAddress: string;
1956
+ } | null)[];
1957
+ }) | null | undefined;
1884
1958
  };
1885
1959
  };
1886
1960
  };
@@ -2385,9 +2459,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2385
2459
  params: Record<never, string>;
2386
2460
  query: {
2387
2461
  items?: number | undefined;
2462
+ chainId?: number | undefined;
2388
2463
  page?: number | undefined;
2389
- chainId: number;
2390
- campaignId: string;
2464
+ campaignId?: string | undefined;
2391
2465
  };
2392
2466
  headers: unknown;
2393
2467
  response: {
@@ -2404,9 +2478,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2404
2478
  params: Record<never, string>;
2405
2479
  query: {
2406
2480
  items?: number | undefined;
2481
+ chainId?: number | undefined;
2407
2482
  page?: number | undefined;
2408
- chainId: number;
2409
- campaignId: string;
2483
+ campaignId?: string | undefined;
2410
2484
  };
2411
2485
  headers: unknown;
2412
2486
  response: {
@@ -3806,7 +3880,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3806
3880
  query?: Record<string, unknown> | undefined;
3807
3881
  fetch?: RequestInit | undefined;
3808
3882
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
3809
- 200: {
3883
+ 200: ({
3810
3884
  aprRecord: {
3811
3885
  cumulated: number;
3812
3886
  timestamp: bigint;
@@ -3876,7 +3950,44 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3876
3950
  tvl: number;
3877
3951
  apr: number;
3878
3952
  dailyRewards: number;
3879
- } | null | undefined;
3953
+ } & {
3954
+ campaigns: ({
3955
+ params: any;
3956
+ chain: {
3957
+ id: number;
3958
+ name: string;
3959
+ icon: string;
3960
+ };
3961
+ rewardToken: {
3962
+ id: string;
3963
+ name: string | null;
3964
+ chainId: number;
3965
+ address: string;
3966
+ decimals: number;
3967
+ symbol: string;
3968
+ icon: string;
3969
+ verified: boolean;
3970
+ price: number | null;
3971
+ };
3972
+ distributionChain: {
3973
+ id: number;
3974
+ name: string;
3975
+ icon: string;
3976
+ } | undefined;
3977
+ id: string;
3978
+ computeChainId: number;
3979
+ distributionChainId: number;
3980
+ campaignId: string;
3981
+ type: import("../../database/api/.generated").$Enums.CampaignType;
3982
+ subType: number | null;
3983
+ rewardTokenId: string;
3984
+ amount: string;
3985
+ opportunityId: string;
3986
+ startTimestamp: bigint;
3987
+ endTimestamp: bigint;
3988
+ creatorAddress: string;
3989
+ } | null)[];
3990
+ }) | null | undefined;
3880
3991
  }>>;
3881
3992
  };
3882
3993
  }) & {
@@ -4325,9 +4436,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4325
4436
  headers?: Record<string, unknown> | undefined;
4326
4437
  query: {
4327
4438
  items?: number | undefined;
4439
+ chainId?: number | undefined;
4328
4440
  page?: number | undefined;
4329
- chainId: number;
4330
- campaignId: string;
4441
+ campaignId?: string | undefined;
4331
4442
  };
4332
4443
  fetch?: RequestInit | undefined;
4333
4444
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -4339,9 +4450,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4339
4450
  headers?: Record<string, unknown> | undefined;
4340
4451
  query: {
4341
4452
  items?: number | undefined;
4453
+ chainId?: number | undefined;
4342
4454
  page?: number | undefined;
4343
- chainId: number;
4344
- campaignId: string;
4455
+ campaignId?: string | undefined;
4345
4456
  };
4346
4457
  fetch?: RequestInit | undefined;
4347
4458
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -164,7 +164,7 @@ declare const app: Elysia<"", false, {
164
164
  query: unknown;
165
165
  headers: unknown;
166
166
  response: {
167
- 200: {
167
+ 200: ({
168
168
  aprRecord: {
169
169
  cumulated: number;
170
170
  timestamp: bigint;
@@ -234,7 +234,44 @@ declare const app: Elysia<"", false, {
234
234
  tvl: number;
235
235
  apr: number;
236
236
  dailyRewards: number;
237
- } | null | undefined;
237
+ } & {
238
+ campaigns: ({
239
+ params: any;
240
+ chain: {
241
+ id: number;
242
+ name: string;
243
+ icon: string;
244
+ };
245
+ rewardToken: {
246
+ id: string;
247
+ name: string | null;
248
+ chainId: number;
249
+ address: string;
250
+ decimals: number;
251
+ symbol: string;
252
+ icon: string;
253
+ verified: boolean;
254
+ price: number | null;
255
+ };
256
+ distributionChain: {
257
+ id: number;
258
+ name: string;
259
+ icon: string;
260
+ } | undefined;
261
+ id: string;
262
+ computeChainId: number;
263
+ distributionChainId: number;
264
+ campaignId: string;
265
+ type: import("../database/api/.generated").$Enums.CampaignType;
266
+ subType: number | null;
267
+ rewardTokenId: string;
268
+ amount: string;
269
+ opportunityId: string;
270
+ startTimestamp: bigint;
271
+ endTimestamp: bigint;
272
+ creatorAddress: string;
273
+ } | null)[];
274
+ }) | null | undefined;
238
275
  };
239
276
  };
240
277
  };
@@ -739,9 +776,9 @@ declare const app: Elysia<"", false, {
739
776
  params: Record<never, string>;
740
777
  query: {
741
778
  items?: number | undefined;
779
+ chainId?: number | undefined;
742
780
  page?: number | undefined;
743
- chainId: number;
744
- campaignId: string;
781
+ campaignId?: string | undefined;
745
782
  };
746
783
  headers: unknown;
747
784
  response: {
@@ -758,9 +795,9 @@ declare const app: Elysia<"", false, {
758
795
  params: Record<never, string>;
759
796
  query: {
760
797
  items?: number | undefined;
798
+ chainId?: number | undefined;
761
799
  page?: number | undefined;
762
- chainId: number;
763
- campaignId: string;
800
+ campaignId?: string | undefined;
764
801
  };
765
802
  headers: unknown;
766
803
  response: {
@@ -0,0 +1,13 @@
1
+ export declare enum TTLPresets {
2
+ MIN_1 = 60,
3
+ MIN_5 = 300,
4
+ MIN_10 = 600,
5
+ MIN_30 = 1800,
6
+ HOUR_1 = 3600,
7
+ HOUR_4 = 14400,
8
+ HOUR_8 = 28800,
9
+ HOUR_12 = 43200,
10
+ DAY_1 = 86400,
11
+ WEEK_1 = 604800,
12
+ MONTH_1 = 2592000
13
+ }
@@ -0,0 +1,4 @@
1
+ export declare abstract class CacheRepository {
2
+ static set(ttl: number, key: string, value: string): Promise<void>;
3
+ static get(key: string): Promise<string | null>;
4
+ }
@@ -0,0 +1,8 @@
1
+ export declare abstract class CacheService {
2
+ #private;
3
+ private static encoder;
4
+ private static decoder;
5
+ static wrap<Fn extends (...args: Args) => Promise<unknown>, Args extends unknown[], T extends Awaited<ReturnType<Fn>>>(ttl: number, fn: Fn, ...args: Args): Promise<T>;
6
+ static set<Fn extends (...args: Args) => Promise<unknown>, Args extends unknown[], T extends Awaited<ReturnType<Fn>>>(ttl: number, fn: Fn, ...args: Args): Promise<T>;
7
+ static get<Fn extends (...args: Args) => Promise<unknown>, Args extends unknown[], T extends Awaited<ReturnType<Fn>>>(fn: Fn, args: Args): Promise<T | null>;
8
+ }
@@ -0,0 +1 @@
1
+ export * from "./cache.service";
@@ -137,7 +137,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
137
137
  query: unknown;
138
138
  headers: unknown;
139
139
  response: {
140
- 200: {
140
+ 200: ({
141
141
  aprRecord: {
142
142
  cumulated: number;
143
143
  timestamp: bigint;
@@ -207,7 +207,44 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
207
207
  tvl: number;
208
208
  apr: number;
209
209
  dailyRewards: number;
210
- } | null | undefined;
210
+ } & {
211
+ campaigns: ({
212
+ params: any;
213
+ chain: {
214
+ id: number;
215
+ name: string;
216
+ icon: string;
217
+ };
218
+ rewardToken: {
219
+ id: string;
220
+ name: string | null;
221
+ chainId: number;
222
+ address: string;
223
+ decimals: number;
224
+ symbol: string;
225
+ icon: string;
226
+ verified: boolean;
227
+ price: number | null;
228
+ };
229
+ distributionChain: {
230
+ id: number;
231
+ name: string;
232
+ icon: string;
233
+ } | undefined;
234
+ id: string;
235
+ computeChainId: number;
236
+ distributionChainId: number;
237
+ campaignId: string;
238
+ type: import("../../../../database/api/.generated").$Enums.CampaignType;
239
+ subType: number | null;
240
+ rewardTokenId: string;
241
+ amount: string;
242
+ opportunityId: string;
243
+ startTimestamp: bigint;
244
+ endTimestamp: bigint;
245
+ creatorAddress: string;
246
+ } | null)[];
247
+ }) | null | undefined;
211
248
  };
212
249
  };
213
250
  };
@@ -18,9 +18,9 @@ export declare const RewardController: Elysia<"/rewards", false, {
18
18
  params: Record<never, string>;
19
19
  query: {
20
20
  items?: number | undefined;
21
+ chainId?: number | undefined;
21
22
  page?: number | undefined;
22
- chainId: number;
23
- campaignId: string;
23
+ campaignId?: string | undefined;
24
24
  };
25
25
  headers: unknown;
26
26
  response: {
@@ -37,9 +37,9 @@ export declare const RewardController: Elysia<"/rewards", false, {
37
37
  params: Record<never, string>;
38
38
  query: {
39
39
  items?: number | undefined;
40
+ chainId?: number | undefined;
40
41
  page?: number | undefined;
41
- chainId: number;
42
- campaignId: string;
42
+ campaignId?: string | undefined;
43
43
  };
44
44
  headers: unknown;
45
45
  response: {
@@ -107,8 +107,8 @@ export declare const RewardsPerChainDto: import("@sinclair/typebox").TObject<{
107
107
  chainId: import("@sinclair/typebox").TNumber;
108
108
  }>;
109
109
  export declare const CampaignIdListDto: import("@sinclair/typebox").TObject<{
110
- chainId: import("@sinclair/typebox").TNumber;
111
- campaignId: import("@sinclair/typebox").TString;
110
+ chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
111
+ campaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
112
112
  page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
113
113
  items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
114
114
  }>;
@@ -146,7 +146,7 @@ export declare const v4: Elysia<"/v4", false, {
146
146
  query: unknown;
147
147
  headers: unknown;
148
148
  response: {
149
- 200: {
149
+ 200: ({
150
150
  aprRecord: {
151
151
  cumulated: number;
152
152
  timestamp: bigint;
@@ -216,7 +216,44 @@ export declare const v4: Elysia<"/v4", false, {
216
216
  tvl: number;
217
217
  apr: number;
218
218
  dailyRewards: number;
219
- } | null | undefined;
219
+ } & {
220
+ campaigns: ({
221
+ params: any;
222
+ chain: {
223
+ id: number;
224
+ name: string;
225
+ icon: string;
226
+ };
227
+ rewardToken: {
228
+ id: string;
229
+ name: string | null;
230
+ chainId: number;
231
+ address: string;
232
+ decimals: number;
233
+ symbol: string;
234
+ icon: string;
235
+ verified: boolean;
236
+ price: number | null;
237
+ };
238
+ distributionChain: {
239
+ id: number;
240
+ name: string;
241
+ icon: string;
242
+ } | undefined;
243
+ id: string;
244
+ computeChainId: number;
245
+ distributionChainId: number;
246
+ campaignId: string;
247
+ type: import("../../../database/api/.generated").$Enums.CampaignType;
248
+ subType: number | null;
249
+ rewardTokenId: string;
250
+ amount: string;
251
+ opportunityId: string;
252
+ startTimestamp: bigint;
253
+ endTimestamp: bigint;
254
+ creatorAddress: string;
255
+ } | null)[];
256
+ }) | null | undefined;
220
257
  };
221
258
  };
222
259
  };
@@ -721,9 +758,9 @@ export declare const v4: Elysia<"/v4", false, {
721
758
  params: Record<never, string>;
722
759
  query: {
723
760
  items?: number | undefined;
761
+ chainId?: number | undefined;
724
762
  page?: number | undefined;
725
- chainId: number;
726
- campaignId: string;
763
+ campaignId?: string | undefined;
727
764
  };
728
765
  headers: unknown;
729
766
  response: {
@@ -740,9 +777,9 @@ export declare const v4: Elysia<"/v4", false, {
740
777
  params: Record<never, string>;
741
778
  query: {
742
779
  items?: number | undefined;
780
+ chainId?: number | undefined;
743
781
  page?: number | undefined;
744
- chainId: number;
745
- campaignId: string;
782
+ campaignId?: string | undefined;
746
783
  };
747
784
  headers: unknown;
748
785
  response: {
@@ -172,7 +172,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
172
172
  query: unknown;
173
173
  headers: unknown;
174
174
  response: {
175
- 200: {
175
+ 200: ({
176
176
  aprRecord: {
177
177
  cumulated: number;
178
178
  timestamp: bigint;
@@ -242,7 +242,44 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
242
242
  tvl: number;
243
243
  apr: number;
244
244
  dailyRewards: number;
245
- } | null | undefined;
245
+ } & {
246
+ campaigns: ({
247
+ params: any;
248
+ chain: {
249
+ id: number;
250
+ name: string;
251
+ icon: string;
252
+ };
253
+ rewardToken: {
254
+ id: string;
255
+ name: string | null;
256
+ chainId: number;
257
+ address: string;
258
+ decimals: number;
259
+ symbol: string;
260
+ icon: string;
261
+ verified: boolean;
262
+ price: number | null;
263
+ };
264
+ distributionChain: {
265
+ id: number;
266
+ name: string;
267
+ icon: string;
268
+ } | undefined;
269
+ id: string;
270
+ computeChainId: number;
271
+ distributionChainId: number;
272
+ campaignId: string;
273
+ type: import("../../../database/api/.generated").$Enums.CampaignType;
274
+ subType: number | null;
275
+ rewardTokenId: string;
276
+ amount: string;
277
+ opportunityId: string;
278
+ startTimestamp: bigint;
279
+ endTimestamp: bigint;
280
+ creatorAddress: string;
281
+ } | null)[];
282
+ }) | null | undefined;
246
283
  };
247
284
  };
248
285
  };
@@ -747,9 +784,9 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
747
784
  params: Record<never, string>;
748
785
  query: {
749
786
  items?: number | undefined;
787
+ chainId?: number | undefined;
750
788
  page?: number | undefined;
751
- chainId: number;
752
- campaignId: string;
789
+ campaignId?: string | undefined;
753
790
  };
754
791
  headers: unknown;
755
792
  response: {
@@ -766,9 +803,9 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
766
803
  params: Record<never, string>;
767
804
  query: {
768
805
  items?: number | undefined;
806
+ chainId?: number | undefined;
769
807
  page?: number | undefined;
770
- chainId: number;
771
- campaignId: string;
808
+ campaignId?: string | undefined;
772
809
  };
773
810
  headers: unknown;
774
811
  response: {