@merkl/api 0.10.107 → 0.10.109

Sign up to get free protection for your applications and to get access to all the features.
@@ -619,11 +619,11 @@ declare const eden: {
619
619
  items?: number | undefined;
620
620
  page?: number | undefined;
621
621
  chainId: number;
622
- campaignIds: string;
622
+ campaignId: string;
623
623
  };
624
624
  fetch?: RequestInit | undefined;
625
625
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
626
- 200: unknown;
626
+ 200: import("../modules/v4/reward").BreakdownForCampaignsRaw[];
627
627
  }>>;
628
628
  };
629
629
  total: {
@@ -633,7 +633,7 @@ declare const eden: {
633
633
  items?: number | undefined;
634
634
  page?: number | undefined;
635
635
  chainId: number;
636
- campaignIds: string;
636
+ campaignId: string;
637
637
  };
638
638
  fetch?: RequestInit | undefined;
639
639
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -715,16 +715,18 @@ declare const eden: {
715
715
  };
716
716
  count: {
717
717
  get: (options: {
718
- headers: {
719
- authorization: string;
718
+ headers?: Record<string, unknown> | undefined;
719
+ query: {
720
+ items?: number | undefined;
721
+ chainId?: number | undefined;
722
+ page?: number | undefined;
723
+ campaignId?: string | undefined;
720
724
  };
721
- query?: Record<string, unknown> | undefined;
722
725
  fetch?: RequestInit | undefined;
723
726
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
724
- 200: Record<string, {
725
- breakdown: number;
726
- rewards: Record<string, number>;
727
- }>;
727
+ 200: {
728
+ count: number;
729
+ } | null;
728
730
  }>>;
729
731
  };
730
732
  };
@@ -2385,11 +2387,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2385
2387
  items?: number | undefined;
2386
2388
  page?: number | undefined;
2387
2389
  chainId: number;
2388
- campaignIds: string;
2390
+ campaignId: string;
2389
2391
  };
2390
2392
  headers: unknown;
2391
2393
  response: {
2392
- 200: unknown;
2394
+ 200: import("../modules/v4/reward").BreakdownForCampaignsRaw[];
2393
2395
  };
2394
2396
  };
2395
2397
  };
@@ -2404,7 +2406,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2404
2406
  items?: number | undefined;
2405
2407
  page?: number | undefined;
2406
2408
  chainId: number;
2407
- campaignIds: string;
2409
+ campaignId: string;
2408
2410
  };
2409
2411
  headers: unknown;
2410
2412
  response: {
@@ -2509,15 +2511,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2509
2511
  get: {
2510
2512
  body: unknown;
2511
2513
  params: Record<never, string>;
2512
- query: unknown;
2513
- headers: {
2514
- authorization: string;
2514
+ query: {
2515
+ items?: number | undefined;
2516
+ chainId?: number | undefined;
2517
+ page?: number | undefined;
2518
+ campaignId?: string | undefined;
2515
2519
  };
2520
+ headers: unknown;
2516
2521
  response: {
2517
- 200: Record<string, {
2518
- breakdown: number;
2519
- rewards: Record<string, number>;
2520
- }>;
2522
+ 200: {
2523
+ count: number;
2524
+ } | null;
2521
2525
  };
2522
2526
  };
2523
2527
  };
@@ -4323,11 +4327,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4323
4327
  items?: number | undefined;
4324
4328
  page?: number | undefined;
4325
4329
  chainId: number;
4326
- campaignIds: string;
4330
+ campaignId: string;
4327
4331
  };
4328
4332
  fetch?: RequestInit | undefined;
4329
4333
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4330
- 200: unknown;
4334
+ 200: import("../modules/v4/reward").BreakdownForCampaignsRaw[];
4331
4335
  }>>;
4332
4336
  };
4333
4337
  total: {
@@ -4337,7 +4341,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4337
4341
  items?: number | undefined;
4338
4342
  page?: number | undefined;
4339
4343
  chainId: number;
4340
- campaignIds: string;
4344
+ campaignId: string;
4341
4345
  };
4342
4346
  fetch?: RequestInit | undefined;
4343
4347
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -4419,16 +4423,18 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4419
4423
  };
4420
4424
  count: {
4421
4425
  get: (options: {
4422
- headers: {
4423
- authorization: string;
4426
+ headers?: Record<string, unknown> | undefined;
4427
+ query: {
4428
+ items?: number | undefined;
4429
+ chainId?: number | undefined;
4430
+ page?: number | undefined;
4431
+ campaignId?: string | undefined;
4424
4432
  };
4425
- query?: Record<string, unknown> | undefined;
4426
4433
  fetch?: RequestInit | undefined;
4427
4434
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4428
- 200: Record<string, {
4429
- breakdown: number;
4430
- rewards: Record<string, number>;
4431
- }>;
4435
+ 200: {
4436
+ count: number;
4437
+ } | null;
4432
4438
  }>>;
4433
4439
  };
4434
4440
  };
@@ -741,11 +741,11 @@ declare const app: Elysia<"", false, {
741
741
  items?: number | undefined;
742
742
  page?: number | undefined;
743
743
  chainId: number;
744
- campaignIds: string;
744
+ campaignId: string;
745
745
  };
746
746
  headers: unknown;
747
747
  response: {
748
- 200: unknown;
748
+ 200: import("./modules/v4/reward").BreakdownForCampaignsRaw[];
749
749
  };
750
750
  };
751
751
  };
@@ -760,7 +760,7 @@ declare const app: Elysia<"", false, {
760
760
  items?: number | undefined;
761
761
  page?: number | undefined;
762
762
  chainId: number;
763
- campaignIds: string;
763
+ campaignId: string;
764
764
  };
765
765
  headers: unknown;
766
766
  response: {
@@ -865,15 +865,17 @@ declare const app: Elysia<"", false, {
865
865
  get: {
866
866
  body: unknown;
867
867
  params: Record<never, string>;
868
- query: unknown;
869
- headers: {
870
- authorization: string;
868
+ query: {
869
+ items?: number | undefined;
870
+ chainId?: number | undefined;
871
+ page?: number | undefined;
872
+ campaignId?: string | undefined;
871
873
  };
874
+ headers: unknown;
872
875
  response: {
873
- 200: Record<string, {
874
- breakdown: number;
875
- rewards: Record<string, number>;
876
- }>;
876
+ 200: {
877
+ count: number;
878
+ } | null;
877
879
  };
878
880
  };
879
881
  };
@@ -20,11 +20,11 @@ export declare const RewardController: Elysia<"/rewards", false, {
20
20
  items?: number | undefined;
21
21
  page?: number | undefined;
22
22
  chainId: number;
23
- campaignIds: string;
23
+ campaignId: string;
24
24
  };
25
25
  headers: unknown;
26
26
  response: {
27
- 200: unknown;
27
+ 200: import("./reward.model").BreakdownForCampaignsRaw[];
28
28
  };
29
29
  };
30
30
  };
@@ -39,7 +39,7 @@ export declare const RewardController: Elysia<"/rewards", false, {
39
39
  items?: number | undefined;
40
40
  page?: number | undefined;
41
41
  chainId: number;
42
- campaignIds: string;
42
+ campaignId: string;
43
43
  };
44
44
  headers: unknown;
45
45
  response: {
@@ -144,15 +144,17 @@ export declare const RewardController: Elysia<"/rewards", false, {
144
144
  get: {
145
145
  body: unknown;
146
146
  params: Record<never, string>;
147
- query: unknown;
148
- headers: {
149
- authorization: string;
147
+ query: {
148
+ items?: number | undefined;
149
+ chainId?: number | undefined;
150
+ page?: number | undefined;
151
+ campaignId?: string | undefined;
150
152
  };
153
+ headers: unknown;
151
154
  response: {
152
- 200: Record<string, {
153
- breakdown: number;
154
- rewards: Record<string, number>;
155
- }>;
155
+ 200: {
156
+ count: number;
157
+ } | null;
156
158
  };
157
159
  };
158
160
  };
@@ -108,7 +108,7 @@ export declare const RewardsPerChainDto: import("@sinclair/typebox").TObject<{
108
108
  }>;
109
109
  export declare const CampaignIdListDto: import("@sinclair/typebox").TObject<{
110
110
  chainId: import("@sinclair/typebox").TNumber;
111
- campaignIds: import("@sinclair/typebox").TString;
111
+ campaignId: 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,6 +146,12 @@ export declare const RewardV3Dto: import("@sinclair/typebox").TRecord<import("@s
146
146
  symbol: import("@sinclair/typebox").TString;
147
147
  }>>;
148
148
  }>>;
149
+ export declare const GetRewardsQueryDto: import("@sinclair/typebox").TObject<{
150
+ page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
151
+ items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
152
+ campaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
153
+ chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
154
+ }>;
149
155
  export type CreateManyRewardModel = typeof CreateManyRewardDto.static;
150
156
  export type CreateManyBreakdownModel = typeof CreateManyBreakdownDto.static;
151
157
  export type RewardEntity = typeof RewardDto.static;
@@ -155,4 +161,22 @@ export type PendingEntity = typeof PendingDto.static;
155
161
  export type CampaignIdListModel = typeof CampaignIdListDto.static;
156
162
  export type UserRewardV3Model = typeof UserRewardV3Dto.static;
157
163
  export type RewardV3Model = typeof RewardV3Dto.static;
164
+ export type GetRewardsQueryModel = typeof GetRewardsQueryDto.static;
165
+ export type BreakdownForCampaignsRaw = {
166
+ amount: string;
167
+ recipient: string;
168
+ campaignId: string;
169
+ reason: string;
170
+ Token: {
171
+ id: string;
172
+ name: string;
173
+ chainId: number;
174
+ address: string;
175
+ decimals: number;
176
+ symbol: string;
177
+ icon: string;
178
+ verified: boolean;
179
+ price: number;
180
+ };
181
+ };
158
182
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { Prisma } from "../../../../database/api/.generated";
2
- import type { CampaignIdListModel, CreateManyBreakdownModel, CreateManyRewardModel, PendingEntity } from "./reward.model";
2
+ import type { BreakdownForCampaignsRaw, CampaignIdListModel, CreateManyBreakdownModel, CreateManyRewardModel, PendingEntity } from "./reward.model";
3
3
  export declare abstract class RewardRepository {
4
4
  static createManyReward(rewards: CreateManyRewardModel): Promise<Prisma.BatchPayload>;
5
5
  static createManyBreakdown(data: CreateManyBreakdownModel): Promise<Prisma.BatchPayload>;
@@ -144,6 +144,9 @@ export declare abstract class RewardRepository {
144
144
  campaignId: string;
145
145
  }[]>;
146
146
  static findManyRootsWithRewardOnChain(chainId: number): Promise<string[]>;
147
- static breakdownForCampaigns(root: string, campaignIds: string[], query: CampaignIdListModel): Promise<unknown>;
147
+ static breakdownForCampaigns(root: string, campaignId: string, query: CampaignIdListModel): Promise<BreakdownForCampaignsRaw[]>;
148
148
  static total(campaignIds: string[]): Promise<unknown>;
149
+ static count(campaignId: string, root: string): Promise<{
150
+ count: number;
151
+ }>;
149
152
  }
@@ -2,7 +2,7 @@ import type { CacheKeys } from "../../../cache/keys";
2
2
  import type { Chain } from "../../../../database/api/.generated";
3
3
  import { Campaign, type CampaignDynamicData, type ChainId } from "@sdk";
4
4
  import { type LightOpportunityFromDB, type Opportunity } from "../opportunity";
5
- import type { CampaignIdListModel, CreateManyBreakdownModel, CreateManyRewardModel, DailyRewardsRecord, RewardBreakdown, UpdatePendingModel } from "./reward.model";
5
+ import type { CampaignIdListModel, CreateManyBreakdownModel, CreateManyRewardModel, DailyRewardsRecord, GetRewardsQueryModel, RewardBreakdown, UpdatePendingModel } from "./reward.model";
6
6
  import { RewardRepository } from "./reward.repository";
7
7
  export declare abstract class RewardService {
8
8
  static hashId(root: string, recipient: string, rewardTokenId: string): string;
@@ -520,11 +520,14 @@ export declare abstract class RewardService {
520
520
  rewards: Awaited<ReturnType<(typeof RewardService)["format"]>>;
521
521
  }[]>;
522
522
  static updatePendings(data: UpdatePendingModel): Promise<boolean>;
523
- static count(): Promise<Record<string, {
523
+ static count(query: GetRewardsQueryModel): Promise<{
524
+ count: number;
525
+ } | null>;
526
+ static countAllchains(): Promise<Record<string, {
524
527
  breakdown: number;
525
528
  rewards: Record<string, number>;
526
529
  }>>;
527
- static breakdownForCampaigns(query: CampaignIdListModel): Promise<unknown>;
530
+ static breakdownForCampaigns(query: CampaignIdListModel): Promise<import("./reward.model").BreakdownForCampaignsRaw[]>;
528
531
  static total(query: CampaignIdListModel): Promise<unknown>;
529
532
  static extractDailyRewardsRecordFromDynamicData<C extends Campaign>(type: C, dynamicData: CampaignDynamicData<C>[], timestamp?: bigint): Promise<DailyRewardsRecord["model"]>;
530
533
  }
@@ -723,11 +723,11 @@ export declare const v4: Elysia<"/v4", false, {
723
723
  items?: number | undefined;
724
724
  page?: number | undefined;
725
725
  chainId: number;
726
- campaignIds: string;
726
+ campaignId: string;
727
727
  };
728
728
  headers: unknown;
729
729
  response: {
730
- 200: unknown;
730
+ 200: import("./reward").BreakdownForCampaignsRaw[];
731
731
  };
732
732
  };
733
733
  };
@@ -742,7 +742,7 @@ export declare const v4: Elysia<"/v4", false, {
742
742
  items?: number | undefined;
743
743
  page?: number | undefined;
744
744
  chainId: number;
745
- campaignIds: string;
745
+ campaignId: string;
746
746
  };
747
747
  headers: unknown;
748
748
  response: {
@@ -847,15 +847,17 @@ export declare const v4: Elysia<"/v4", false, {
847
847
  get: {
848
848
  body: unknown;
849
849
  params: Record<never, string>;
850
- query: unknown;
851
- headers: {
852
- authorization: string;
850
+ query: {
851
+ items?: number | undefined;
852
+ chainId?: number | undefined;
853
+ page?: number | undefined;
854
+ campaignId?: string | undefined;
853
855
  };
856
+ headers: unknown;
854
857
  response: {
855
- 200: Record<string, {
856
- breakdown: number;
857
- rewards: Record<string, number>;
858
- }>;
858
+ 200: {
859
+ count: number;
860
+ } | null;
859
861
  };
860
862
  };
861
863
  };
@@ -749,11 +749,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
749
749
  items?: number | undefined;
750
750
  page?: number | undefined;
751
751
  chainId: number;
752
- campaignIds: string;
752
+ campaignId: string;
753
753
  };
754
754
  headers: unknown;
755
755
  response: {
756
- 200: unknown;
756
+ 200: import("../../modules/v4/reward").BreakdownForCampaignsRaw[];
757
757
  };
758
758
  };
759
759
  };
@@ -768,7 +768,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
768
768
  items?: number | undefined;
769
769
  page?: number | undefined;
770
770
  chainId: number;
771
- campaignIds: string;
771
+ campaignId: string;
772
772
  };
773
773
  headers: unknown;
774
774
  response: {
@@ -873,15 +873,17 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
873
873
  get: {
874
874
  body: unknown;
875
875
  params: Record<never, string>;
876
- query: unknown;
877
- headers: {
878
- authorization: string;
876
+ query: {
877
+ items?: number | undefined;
878
+ chainId?: number | undefined;
879
+ page?: number | undefined;
880
+ campaignId?: string | undefined;
879
881
  };
882
+ headers: unknown;
880
883
  response: {
881
- 200: Record<string, {
882
- breakdown: number;
883
- rewards: Record<string, number>;
884
- }>;
884
+ 200: {
885
+ count: number;
886
+ } | null;
885
887
  };
886
888
  };
887
889
  };
@@ -747,11 +747,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
747
747
  items?: number | undefined;
748
748
  page?: number | undefined;
749
749
  chainId: number;
750
- campaignIds: string;
750
+ campaignId: string;
751
751
  };
752
752
  headers: unknown;
753
753
  response: {
754
- 200: unknown;
754
+ 200: import("../../modules/v4/reward").BreakdownForCampaignsRaw[];
755
755
  };
756
756
  };
757
757
  };
@@ -766,7 +766,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
766
766
  items?: number | undefined;
767
767
  page?: number | undefined;
768
768
  chainId: number;
769
- campaignIds: string;
769
+ campaignId: string;
770
770
  };
771
771
  headers: unknown;
772
772
  response: {
@@ -871,15 +871,17 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
871
871
  get: {
872
872
  body: unknown;
873
873
  params: Record<never, string>;
874
- query: unknown;
875
- headers: {
876
- authorization: string;
874
+ query: {
875
+ items?: number | undefined;
876
+ chainId?: number | undefined;
877
+ page?: number | undefined;
878
+ campaignId?: string | undefined;
877
879
  };
880
+ headers: unknown;
878
881
  response: {
879
- 200: Record<string, {
880
- breakdown: number;
881
- rewards: Record<string, number>;
882
- }>;
882
+ 200: {
883
+ count: number;
884
+ } | null;
883
885
  };
884
886
  };
885
887
  };
@@ -750,11 +750,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
750
750
  items?: number | undefined;
751
751
  page?: number | undefined;
752
752
  chainId: number;
753
- campaignIds: string;
753
+ campaignId: string;
754
754
  };
755
755
  headers: unknown;
756
756
  response: {
757
- 200: unknown;
757
+ 200: import("../../modules/v4/reward").BreakdownForCampaignsRaw[];
758
758
  };
759
759
  };
760
760
  };
@@ -769,7 +769,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
769
769
  items?: number | undefined;
770
770
  page?: number | undefined;
771
771
  chainId: number;
772
- campaignIds: string;
772
+ campaignId: string;
773
773
  };
774
774
  headers: unknown;
775
775
  response: {
@@ -874,15 +874,17 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
874
874
  get: {
875
875
  body: unknown;
876
876
  params: Record<never, string>;
877
- query: unknown;
878
- headers: {
879
- authorization: string;
877
+ query: {
878
+ items?: number | undefined;
879
+ chainId?: number | undefined;
880
+ page?: number | undefined;
881
+ campaignId?: string | undefined;
880
882
  };
883
+ headers: unknown;
881
884
  response: {
882
- 200: Record<string, {
883
- breakdown: number;
884
- rewards: Record<string, number>;
885
- }>;
885
+ 200: {
886
+ count: number;
887
+ } | null;
886
888
  };
887
889
  };
888
890
  };
@@ -741,11 +741,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
741
741
  items?: number | undefined;
742
742
  page?: number | undefined;
743
743
  chainId: number;
744
- campaignIds: string;
744
+ campaignId: string;
745
745
  };
746
746
  headers: unknown;
747
747
  response: {
748
- 200: unknown;
748
+ 200: import("../../modules/v4/reward").BreakdownForCampaignsRaw[];
749
749
  };
750
750
  };
751
751
  };
@@ -760,7 +760,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
760
760
  items?: number | undefined;
761
761
  page?: number | undefined;
762
762
  chainId: number;
763
- campaignIds: string;
763
+ campaignId: string;
764
764
  };
765
765
  headers: unknown;
766
766
  response: {
@@ -865,15 +865,17 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
865
865
  get: {
866
866
  body: unknown;
867
867
  params: Record<never, string>;
868
- query: unknown;
869
- headers: {
870
- authorization: string;
868
+ query: {
869
+ items?: number | undefined;
870
+ chainId?: number | undefined;
871
+ page?: number | undefined;
872
+ campaignId?: string | undefined;
871
873
  };
874
+ headers: unknown;
872
875
  response: {
873
- 200: Record<string, {
874
- breakdown: number;
875
- rewards: Record<string, number>;
876
- }>;
876
+ 200: {
877
+ count: number;
878
+ } | null;
877
879
  };
878
880
  };
879
881
  };
@@ -746,11 +746,11 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
746
746
  items?: number | undefined;
747
747
  page?: number | undefined;
748
748
  chainId: number;
749
- campaignIds: string;
749
+ campaignId: string;
750
750
  };
751
751
  headers: unknown;
752
752
  response: {
753
- 200: unknown;
753
+ 200: import("../../modules/v4/reward").BreakdownForCampaignsRaw[];
754
754
  };
755
755
  };
756
756
  };
@@ -765,7 +765,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
765
765
  items?: number | undefined;
766
766
  page?: number | undefined;
767
767
  chainId: number;
768
- campaignIds: string;
768
+ campaignId: string;
769
769
  };
770
770
  headers: unknown;
771
771
  response: {
@@ -870,15 +870,17 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
870
870
  get: {
871
871
  body: unknown;
872
872
  params: Record<never, string>;
873
- query: unknown;
874
- headers: {
875
- authorization: string;
873
+ query: {
874
+ items?: number | undefined;
875
+ chainId?: number | undefined;
876
+ page?: number | undefined;
877
+ campaignId?: string | undefined;
876
878
  };
879
+ headers: unknown;
877
880
  response: {
878
- 200: Record<string, {
879
- breakdown: number;
880
- rewards: Record<string, number>;
881
- }>;
881
+ 200: {
882
+ count: number;
883
+ } | null;
882
884
  };
883
885
  };
884
886
  };