@merkl/api 0.15.39 → 0.15.41

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.
@@ -727,6 +727,11 @@ declare const eden: {
727
727
  computedUntil: bigint;
728
728
  processingStarted: bigint;
729
729
  };
730
+ Creator: {
731
+ tags: string[];
732
+ address: string;
733
+ creatorId: string | null;
734
+ };
730
735
  type: import("../../database/api/.generated").$Enums.CampaignType;
731
736
  id: string;
732
737
  subType: number | null;
@@ -983,6 +988,11 @@ declare const eden: {
983
988
  computedUntil: bigint;
984
989
  processingStarted: bigint;
985
990
  };
991
+ Creator: {
992
+ tags: string[];
993
+ address: string;
994
+ creatorId: string | null;
995
+ };
986
996
  type: import("../../database/api/.generated").$Enums.CampaignType;
987
997
  id: string;
988
998
  subType: number | null;
@@ -1729,6 +1739,25 @@ declare const eden: {
1729
1739
  }[];
1730
1740
  }[];
1731
1741
  }>>;
1742
+ post: (body: {
1743
+ name: string;
1744
+ id: number;
1745
+ icon: string;
1746
+ explorerType: "ETHERSCAN" | "BLOCKSCOUT";
1747
+ explorerUrl: string;
1748
+ }, options: {
1749
+ headers: {
1750
+ authorization: string;
1751
+ };
1752
+ query?: Record<string, unknown> | undefined;
1753
+ fetch?: RequestInit | undefined;
1754
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1755
+ 200: {
1756
+ name: string;
1757
+ id: number;
1758
+ icon: string;
1759
+ };
1760
+ }>>;
1732
1761
  };
1733
1762
  count: {
1734
1763
  get: (options: {
@@ -2701,6 +2730,11 @@ declare const eden: {
2701
2730
  computeChainId: number;
2702
2731
  distributionChainId: number;
2703
2732
  campaignId: string;
2733
+ RewardToken: {
2734
+ symbol: string;
2735
+ address: string;
2736
+ isTest: boolean;
2737
+ };
2704
2738
  }[];
2705
2739
  }>>;
2706
2740
  };
@@ -3812,6 +3846,11 @@ declare const eden: {
3812
3846
  computedUntil: bigint;
3813
3847
  processingStarted: bigint;
3814
3848
  };
3849
+ Creator: {
3850
+ tags: string[];
3851
+ address: string;
3852
+ creatorId: string | null;
3853
+ };
3815
3854
  type: import("../../database/api/.generated").$Enums.CampaignType;
3816
3855
  id: string;
3817
3856
  subType: number | null;
@@ -4068,6 +4107,11 @@ declare const eden: {
4068
4107
  computedUntil: bigint;
4069
4108
  processingStarted: bigint;
4070
4109
  };
4110
+ Creator: {
4111
+ tags: string[];
4112
+ address: string;
4113
+ creatorId: string | null;
4114
+ };
4071
4115
  type: import("../../database/api/.generated").$Enums.CampaignType;
4072
4116
  id: string;
4073
4117
  subType: number | null;
@@ -4814,6 +4858,25 @@ declare const eden: {
4814
4858
  }[];
4815
4859
  }[];
4816
4860
  }>>;
4861
+ post: (body: {
4862
+ name: string;
4863
+ id: number;
4864
+ icon: string;
4865
+ explorerType: "ETHERSCAN" | "BLOCKSCOUT";
4866
+ explorerUrl: string;
4867
+ }, options: {
4868
+ headers: {
4869
+ authorization: string;
4870
+ };
4871
+ query?: Record<string, unknown> | undefined;
4872
+ fetch?: RequestInit | undefined;
4873
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4874
+ 200: {
4875
+ name: string;
4876
+ id: number;
4877
+ icon: string;
4878
+ };
4879
+ }>>;
4817
4880
  };
4818
4881
  count: {
4819
4882
  get: (options: {
@@ -5786,6 +5849,11 @@ declare const eden: {
5786
5849
  computeChainId: number;
5787
5850
  distributionChainId: number;
5788
5851
  campaignId: string;
5852
+ RewardToken: {
5853
+ symbol: string;
5854
+ address: string;
5855
+ isTest: boolean;
5856
+ };
5789
5857
  }[];
5790
5858
  }>>;
5791
5859
  };
@@ -7514,6 +7582,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
7514
7582
  computedUntil: bigint;
7515
7583
  processingStarted: bigint;
7516
7584
  };
7585
+ Creator: {
7586
+ tags: string[];
7587
+ address: string;
7588
+ creatorId: string | null;
7589
+ };
7517
7590
  type: import("../../database/api/.generated").$Enums.CampaignType;
7518
7591
  id: string;
7519
7592
  subType: number | null;
@@ -8001,6 +8074,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8001
8074
  computedUntil: bigint;
8002
8075
  processingStarted: bigint;
8003
8076
  };
8077
+ Creator: {
8078
+ tags: string[];
8079
+ address: string;
8080
+ creatorId: string | null;
8081
+ };
8004
8082
  type: import("../../database/api/.generated").$Enums.CampaignType;
8005
8083
  id: string;
8006
8084
  subType: number | null;
@@ -8966,6 +9044,32 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8966
9044
  };
8967
9045
  };
8968
9046
  };
9047
+ } & {
9048
+ chains: {
9049
+ index: {
9050
+ post: {
9051
+ body: {
9052
+ name: string;
9053
+ id: number;
9054
+ icon: string;
9055
+ explorerType: "ETHERSCAN" | "BLOCKSCOUT";
9056
+ explorerUrl: string;
9057
+ };
9058
+ params: {};
9059
+ query: unknown;
9060
+ headers: {
9061
+ authorization: string;
9062
+ };
9063
+ response: {
9064
+ 200: {
9065
+ name: string;
9066
+ id: number;
9067
+ icon: string;
9068
+ };
9069
+ };
9070
+ };
9071
+ };
9072
+ };
8969
9073
  };
8970
9074
  } & {
8971
9075
  v4: {
@@ -10195,6 +10299,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
10195
10299
  computeChainId: number;
10196
10300
  distributionChainId: number;
10197
10301
  campaignId: string;
10302
+ RewardToken: {
10303
+ symbol: string;
10304
+ address: string;
10305
+ isTest: boolean;
10306
+ };
10198
10307
  }[];
10199
10308
  };
10200
10309
  };
@@ -12331,6 +12440,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12331
12440
  computedUntil: bigint;
12332
12441
  processingStarted: bigint;
12333
12442
  };
12443
+ Creator: {
12444
+ tags: string[];
12445
+ address: string;
12446
+ creatorId: string | null;
12447
+ };
12334
12448
  type: import("../../database/api/.generated").$Enums.CampaignType;
12335
12449
  id: string;
12336
12450
  subType: number | null;
@@ -12587,6 +12701,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12587
12701
  computedUntil: bigint;
12588
12702
  processingStarted: bigint;
12589
12703
  };
12704
+ Creator: {
12705
+ tags: string[];
12706
+ address: string;
12707
+ creatorId: string | null;
12708
+ };
12590
12709
  type: import("../../database/api/.generated").$Enums.CampaignType;
12591
12710
  id: string;
12592
12711
  subType: number | null;
@@ -13333,6 +13452,25 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13333
13452
  }[];
13334
13453
  }[];
13335
13454
  }>>;
13455
+ post: (body: {
13456
+ name: string;
13457
+ id: number;
13458
+ icon: string;
13459
+ explorerType: "ETHERSCAN" | "BLOCKSCOUT";
13460
+ explorerUrl: string;
13461
+ }, options: {
13462
+ headers: {
13463
+ authorization: string;
13464
+ };
13465
+ query?: Record<string, unknown> | undefined;
13466
+ fetch?: RequestInit | undefined;
13467
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13468
+ 200: {
13469
+ name: string;
13470
+ id: number;
13471
+ icon: string;
13472
+ };
13473
+ }>>;
13336
13474
  };
13337
13475
  count: {
13338
13476
  get: (options: {
@@ -14305,6 +14443,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
14305
14443
  computeChainId: number;
14306
14444
  distributionChainId: number;
14307
14445
  campaignId: string;
14446
+ RewardToken: {
14447
+ symbol: string;
14448
+ address: string;
14449
+ isTest: boolean;
14450
+ };
14308
14451
  }[];
14309
14452
  }>>;
14310
14453
  };
@@ -15416,6 +15559,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
15416
15559
  computedUntil: bigint;
15417
15560
  processingStarted: bigint;
15418
15561
  };
15562
+ Creator: {
15563
+ tags: string[];
15564
+ address: string;
15565
+ creatorId: string | null;
15566
+ };
15419
15567
  type: import("../../database/api/.generated").$Enums.CampaignType;
15420
15568
  id: string;
15421
15569
  subType: number | null;
@@ -15672,6 +15820,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
15672
15820
  computedUntil: bigint;
15673
15821
  processingStarted: bigint;
15674
15822
  };
15823
+ Creator: {
15824
+ tags: string[];
15825
+ address: string;
15826
+ creatorId: string | null;
15827
+ };
15675
15828
  type: import("../../database/api/.generated").$Enums.CampaignType;
15676
15829
  id: string;
15677
15830
  subType: number | null;
@@ -16418,6 +16571,25 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
16418
16571
  }[];
16419
16572
  }[];
16420
16573
  }>>;
16574
+ post: (body: {
16575
+ name: string;
16576
+ id: number;
16577
+ icon: string;
16578
+ explorerType: "ETHERSCAN" | "BLOCKSCOUT";
16579
+ explorerUrl: string;
16580
+ }, options: {
16581
+ headers: {
16582
+ authorization: string;
16583
+ };
16584
+ query?: Record<string, unknown> | undefined;
16585
+ fetch?: RequestInit | undefined;
16586
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
16587
+ 200: {
16588
+ name: string;
16589
+ id: number;
16590
+ icon: string;
16591
+ };
16592
+ }>>;
16421
16593
  };
16422
16594
  count: {
16423
16595
  get: (options: {
@@ -17390,6 +17562,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
17390
17562
  computeChainId: number;
17391
17563
  distributionChainId: number;
17392
17564
  campaignId: string;
17565
+ RewardToken: {
17566
+ symbol: string;
17567
+ address: string;
17568
+ isTest: boolean;
17569
+ };
17393
17570
  }[];
17394
17571
  }>>;
17395
17572
  };
@@ -646,6 +646,11 @@ declare const app: Elysia<"", false, {
646
646
  computedUntil: bigint;
647
647
  processingStarted: bigint;
648
648
  };
649
+ Creator: {
650
+ tags: string[];
651
+ address: string;
652
+ creatorId: string | null;
653
+ };
649
654
  type: import("../database/api/.generated").$Enums.CampaignType;
650
655
  id: string;
651
656
  subType: number | null;
@@ -1133,6 +1138,11 @@ declare const app: Elysia<"", false, {
1133
1138
  computedUntil: bigint;
1134
1139
  processingStarted: bigint;
1135
1140
  };
1141
+ Creator: {
1142
+ tags: string[];
1143
+ address: string;
1144
+ creatorId: string | null;
1145
+ };
1136
1146
  type: import("../database/api/.generated").$Enums.CampaignType;
1137
1147
  id: string;
1138
1148
  subType: number | null;
@@ -2098,6 +2108,32 @@ declare const app: Elysia<"", false, {
2098
2108
  };
2099
2109
  };
2100
2110
  };
2111
+ } & {
2112
+ chains: {
2113
+ index: {
2114
+ post: {
2115
+ body: {
2116
+ name: string;
2117
+ id: number;
2118
+ icon: string;
2119
+ explorerType: "ETHERSCAN" | "BLOCKSCOUT";
2120
+ explorerUrl: string;
2121
+ };
2122
+ params: {};
2123
+ query: unknown;
2124
+ headers: {
2125
+ authorization: string;
2126
+ };
2127
+ response: {
2128
+ 200: {
2129
+ name: string;
2130
+ id: number;
2131
+ icon: string;
2132
+ };
2133
+ };
2134
+ };
2135
+ };
2136
+ };
2101
2137
  };
2102
2138
  } & {
2103
2139
  v4: {
@@ -3327,6 +3363,11 @@ declare const app: Elysia<"", false, {
3327
3363
  computeChainId: number;
3328
3364
  distributionChainId: number;
3329
3365
  campaignId: string;
3366
+ RewardToken: {
3367
+ symbol: string;
3368
+ address: string;
3369
+ isTest: boolean;
3370
+ };
3330
3371
  }[];
3331
3372
  };
3332
3373
  };
@@ -164,6 +164,11 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
164
164
  computedUntil: bigint;
165
165
  processingStarted: bigint;
166
166
  };
167
+ Creator: {
168
+ tags: string[];
169
+ address: string;
170
+ creatorId: string | null;
171
+ };
167
172
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
168
173
  id: string;
169
174
  subType: number | null;
@@ -155,6 +155,11 @@ export declare abstract class CampaignRepository {
155
155
  computedUntil: bigint;
156
156
  processingStarted: bigint;
157
157
  }[];
158
+ Creator: {
159
+ tags: string[];
160
+ address: string;
161
+ creatorId: string | null;
162
+ };
158
163
  ComputeChain: {
159
164
  name: string;
160
165
  id: number;
@@ -276,7 +276,7 @@ export class CampaignRepository {
276
276
  }
277
277
  // ─── Search Many Campaigns ───────────────────────────────────────────
278
278
  static async findMany(query) {
279
- const { page: _page, items: _items, ...filters } = query;
279
+ const { page: _page, items: _items, ..._filters } = query;
280
280
  const page = _page ? _page : 0;
281
281
  const items = _items ? _items : 20;
282
282
  const args = CampaignRepository.transformQueryToPrismaFilters(query);
@@ -288,6 +288,7 @@ export class CampaignRepository {
288
288
  ComputeChain: true,
289
289
  RewardToken: true,
290
290
  CampaignStatus: true,
291
+ Creator: true,
291
292
  },
292
293
  orderBy: {
293
294
  endTimestamp: "desc",
@@ -78,6 +78,11 @@ export declare abstract class CampaignService {
78
78
  computedUntil: bigint;
79
79
  processingStarted: bigint;
80
80
  };
81
+ Creator: {
82
+ tags: string[];
83
+ address: string;
84
+ creatorId: string | null;
85
+ };
81
86
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
82
87
  id: string;
83
88
  subType: number | null;
@@ -219,6 +224,11 @@ export declare abstract class CampaignService {
219
224
  computedUntil: bigint;
220
225
  processingStarted: bigint;
221
226
  };
227
+ Creator: {
228
+ tags: string[];
229
+ address: string;
230
+ creatorId: string | null;
231
+ };
222
232
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
223
233
  id: string;
224
234
  subType: number | null;
@@ -103,6 +103,32 @@ export declare const ChainController: Elysia<"/chains", false, {
103
103
  };
104
104
  };
105
105
  };
106
+ } & {
107
+ chains: {
108
+ index: {
109
+ post: {
110
+ body: {
111
+ name: string;
112
+ id: number;
113
+ icon: string;
114
+ explorerType: "ETHERSCAN" | "BLOCKSCOUT";
115
+ explorerUrl: string;
116
+ };
117
+ params: {};
118
+ query: unknown;
119
+ headers: {
120
+ authorization: string;
121
+ };
122
+ response: {
123
+ 200: {
124
+ name: string;
125
+ id: number;
126
+ icon: string;
127
+ };
128
+ };
129
+ };
130
+ };
131
+ };
106
132
  }, {
107
133
  derive: {};
108
134
  resolve: {};
@@ -1,6 +1,6 @@
1
1
  import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
2
2
  import Elysia, { t } from "elysia";
3
- import { ChainResourceDto, ChainUniqueDto, GetChainQueryDto, UpdateChainDto } from "./chain.model";
3
+ import { ChainResourceDto, ChainUniqueDto, CreateChainDto, GetChainQueryDto, UpdateChainDto, } from "./chain.model";
4
4
  import { ChainService } from "./chain.service";
5
5
  // ─── Chains Controller ───────────────────────────────────────────────────────
6
6
  export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: ["Chains"] } })
@@ -35,4 +35,10 @@ export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: [
35
35
  headers: AuthorizationHeadersDto,
36
36
  beforeHandle: BackOfficeGuard,
37
37
  detail: { hide: true },
38
+ })
39
+ .post("/", async ({ body }) => await ChainService.create(body), {
40
+ body: CreateChainDto,
41
+ headers: AuthorizationHeadersDto,
42
+ beforeHandle: BackOfficeGuard,
43
+ detail: { hide: true },
38
44
  });
@@ -25,6 +25,17 @@ export declare const ChainArrayOptionalDto: import("@sinclair/typebox").TObject<
25
25
  export declare const UpdateChainDto: import("@sinclair/typebox").TObject<{
26
26
  icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
27
27
  }>;
28
+ export declare const CreateChainDto: import("@sinclair/typebox").TObject<{
29
+ id: import("@sinclair/typebox").TNumber;
30
+ name: import("@sinclair/typebox").TString;
31
+ icon: import("@sinclair/typebox").TString;
32
+ explorerType: import("@sinclair/typebox").TEnum<{
33
+ ETHERSCAN: "ETHERSCAN";
34
+ BLOCKSCOUT: "BLOCKSCOUT";
35
+ }>;
36
+ explorerUrl: import("@sinclair/typebox").TString;
37
+ }>;
28
38
  export type ChainUniqueModel = typeof ChainUniqueDto.static;
29
39
  export type ChainSearchDto = typeof GetChainQueryDto.static;
30
40
  export type UpdateChainModel = typeof UpdateChainDto.static;
41
+ export type CreateChainModel = typeof CreateChainDto.static;
@@ -1,3 +1,4 @@
1
+ import { ExplorerType } from "../../../../database/api/.generated";
1
2
  import { t } from "elysia";
2
3
  // ─── DTOs ────────────────────────────────────────────────────────────────────
3
4
  export const ChainResourceDto = t.Object({
@@ -26,3 +27,10 @@ export const UpdateChainDto = t.Object({
26
27
  icon: t.Optional(t.String({ format: "uri" })),
27
28
  // iconFile: t.Optional(t.File()),
28
29
  });
30
+ export const CreateChainDto = t.Object({
31
+ id: t.Numeric(),
32
+ name: t.String(),
33
+ icon: t.String({ format: "uri" }),
34
+ explorerType: t.Enum(ExplorerType),
35
+ explorerUrl: t.String({ format: "uri" }),
36
+ });
@@ -1,5 +1,5 @@
1
1
  import type { Campaign, CampaignParameters } from "@sdk";
2
- import type { Chain, ChainSearchDto, UpdateChainModel } from "./chain.model";
2
+ import type { ChainSearchDto, CreateChainModel, UpdateChainModel } from "./chain.model";
3
3
  export declare abstract class ChainRepository {
4
4
  #private;
5
5
  /**
@@ -45,7 +45,7 @@ export declare abstract class ChainRepository {
45
45
  * @param template for chain creation
46
46
  * @returns
47
47
  */
48
- static create(template: Chain["action"]["create"]["args"]): Promise<{
48
+ static create(data: CreateChainModel): Promise<{
49
49
  name: string;
50
50
  id: number;
51
51
  icon: string;
@@ -1,6 +1,7 @@
1
1
  import { campaignsDynamicData } from "../../../libs/campaigns/campaignsDynamicData";
2
2
  import { executeSimple } from "../../../utils/execute";
3
3
  import { apiDbClient } from "../../../utils/prisma";
4
+ import { ExplorerRepository } from "../explorer/explorer.repository";
4
5
  export class ChainRepository {
5
6
  /**
6
7
  * @param id ChainId
@@ -44,8 +45,16 @@ export class ChainRepository {
44
45
  * @param template for chain creation
45
46
  * @returns
46
47
  */
47
- static async create(template) {
48
- return apiDbClient.chain.create(template);
48
+ static async create(data) {
49
+ const explorerId = await ExplorerRepository.create(data.id, data.explorerType, data.explorerUrl);
50
+ return apiDbClient.chain.create({
51
+ data: {
52
+ id: data.id,
53
+ icon: data.icon,
54
+ name: data.name,
55
+ Explorer: { connect: { id: explorerId.id } },
56
+ },
57
+ });
49
58
  }
50
59
  static async findMany() {
51
60
  return apiDbClient.chain.findMany();
@@ -1,4 +1,4 @@
1
- import type { ChainSearchDto, UpdateChainModel } from "./chain.model";
1
+ import type { ChainSearchDto, CreateChainModel, UpdateChainModel } from "./chain.model";
2
2
  export declare abstract class ChainService {
3
3
  static get(chainId: number): Promise<({
4
4
  Explorer: {
@@ -39,6 +39,11 @@ export declare abstract class ChainService {
39
39
  * @returns an array of chainId
40
40
  */
41
41
  static getSupportedIds(): Promise<number[]>;
42
+ static create(chain: CreateChainModel): Promise<{
43
+ name: string;
44
+ id: number;
45
+ icon: string;
46
+ }>;
42
47
  static update(id: number, data: UpdateChainModel): Promise<{
43
48
  name: string;
44
49
  id: number;
@@ -39,11 +39,10 @@ export class ChainService {
39
39
  }
40
40
  return supportedIds;
41
41
  }
42
+ static async create(chain) {
43
+ return await ChainRepository.create(chain);
44
+ }
42
45
  static async update(id, data) {
43
- // let iconUri = data.icon;
44
- // if (data.iconFile) {
45
- // iconUri = await BucketService.upload("merkl-assets", `/chains/${id}`, data.iconFile.stream(), true);
46
- // }
47
46
  return await ChainRepository.update(id, data);
48
47
  }
49
48
  }
@@ -501,6 +501,11 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
501
501
  computedUntil: bigint;
502
502
  processingStarted: bigint;
503
503
  };
504
+ Creator: {
505
+ tags: string[];
506
+ address: string;
507
+ creatorId: string | null;
508
+ };
504
509
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
505
510
  id: string;
506
511
  subType: number | null;
@@ -240,6 +240,11 @@ export declare abstract class OpportunityService {
240
240
  computedUntil: bigint;
241
241
  processingStarted: bigint;
242
242
  };
243
+ Creator: {
244
+ tags: string[];
245
+ address: string;
246
+ creatorId: string | null;
247
+ };
243
248
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
244
249
  id: string;
245
250
  subType: number | null;
@@ -470,6 +475,11 @@ export declare abstract class OpportunityService {
470
475
  computedUntil: bigint;
471
476
  processingStarted: bigint;
472
477
  };
478
+ Creator: {
479
+ tags: string[];
480
+ address: string;
481
+ creatorId: string | null;
482
+ };
473
483
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
474
484
  id: string;
475
485
  subType: number | null;