@merkl/api 0.10.207 → 0.10.208

Sign up to get free protection for your applications and to get access to all the features.
@@ -99,7 +99,7 @@ declare const eden: {
99
99
  url: string;
100
100
  description: string;
101
101
  id: string;
102
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
102
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
103
103
  icon: string;
104
104
  } | null | undefined;
105
105
  aprRecord?: {
@@ -199,7 +199,7 @@ declare const eden: {
199
199
  url: string;
200
200
  description: string;
201
201
  id: string;
202
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
202
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
203
203
  icon: string;
204
204
  } | null | undefined;
205
205
  aprRecord?: {
@@ -760,7 +760,7 @@ declare const eden: {
760
760
  query: {
761
761
  name?: string | undefined;
762
762
  items?: number | undefined;
763
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
763
+ tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
764
764
  page?: number | undefined;
765
765
  };
766
766
  fetch?: RequestInit | undefined;
@@ -779,6 +779,7 @@ declare const eden: {
779
779
  url: string;
780
780
  description: string;
781
781
  id: string;
782
+ tags: File | FileList;
782
783
  icon: string;
783
784
  }, options: {
784
785
  headers: {
@@ -2984,7 +2985,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2984
2985
  url: string;
2985
2986
  description: string;
2986
2987
  id: string;
2987
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
2988
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
2988
2989
  icon: string;
2989
2990
  } | null | undefined;
2990
2991
  aprRecord?: {
@@ -3093,7 +3094,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3093
3094
  url: string;
3094
3095
  description: string;
3095
3096
  id: string;
3096
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
3097
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
3097
3098
  icon: string;
3098
3099
  } | null | undefined;
3099
3100
  aprRecord?: {
@@ -3510,7 +3511,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3510
3511
  query: {
3511
3512
  name?: string | undefined;
3512
3513
  items?: number | undefined;
3513
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
3514
+ tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
3514
3515
  page?: number | undefined;
3515
3516
  };
3516
3517
  headers: unknown;
@@ -3602,6 +3603,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3602
3603
  url: string;
3603
3604
  description: string;
3604
3605
  id: string;
3606
+ tags: never[];
3605
3607
  icon: string;
3606
3608
  };
3607
3609
  params: {};
@@ -6119,7 +6121,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6119
6121
  url: string;
6120
6122
  description: string;
6121
6123
  id: string;
6122
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
6124
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
6123
6125
  icon: string;
6124
6126
  } | null | undefined;
6125
6127
  aprRecord?: {
@@ -6219,7 +6221,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6219
6221
  url: string;
6220
6222
  description: string;
6221
6223
  id: string;
6222
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
6224
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
6223
6225
  icon: string;
6224
6226
  } | null | undefined;
6225
6227
  aprRecord?: {
@@ -6780,7 +6782,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6780
6782
  query: {
6781
6783
  name?: string | undefined;
6782
6784
  items?: number | undefined;
6783
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
6785
+ tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
6784
6786
  page?: number | undefined;
6785
6787
  };
6786
6788
  fetch?: RequestInit | undefined;
@@ -6799,6 +6801,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6799
6801
  url: string;
6800
6802
  description: string;
6801
6803
  id: string;
6804
+ tags: File | FileList;
6802
6805
  icon: string;
6803
6806
  }, options: {
6804
6807
  headers: {
@@ -318,7 +318,7 @@ declare const app: Elysia<"", false, {
318
318
  url: string;
319
319
  description: string;
320
320
  id: string;
321
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
321
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
322
322
  icon: string;
323
323
  } | null | undefined;
324
324
  aprRecord?: {
@@ -427,7 +427,7 @@ declare const app: Elysia<"", false, {
427
427
  url: string;
428
428
  description: string;
429
429
  id: string;
430
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
430
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
431
431
  icon: string;
432
432
  } | null | undefined;
433
433
  aprRecord?: {
@@ -844,7 +844,7 @@ declare const app: Elysia<"", false, {
844
844
  query: {
845
845
  name?: string | undefined;
846
846
  items?: number | undefined;
847
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
847
+ tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
848
848
  page?: number | undefined;
849
849
  };
850
850
  headers: unknown;
@@ -936,6 +936,7 @@ declare const app: Elysia<"", false, {
936
936
  url: string;
937
937
  description: string;
938
938
  id: string;
939
+ tags: never[];
939
940
  icon: string;
940
941
  };
941
942
  params: {};
@@ -83,8 +83,8 @@ export const GetCampaignQueryDto = t.Object({
83
83
  opportunityId: t.Optional(t.String({
84
84
  description: "Filter by opportunity. You can find opportunity ids by calling [GET /v4/opportunities](#tag/opportunities/GET/v4/opportunities)",
85
85
  })),
86
- startTimestamp: t.Optional(t.String({ pattern: "[0-9].*", description: "Returns campaigns starting *after* the given unix timestamp" })),
87
- endTimestamp: t.Optional(t.String({ pattern: "[0-9].*", description: "Returns campaigns ending *after* the given unix timestamp" })),
86
+ startTimestamp: t.Optional(t.String({ pattern: "[0-9]*", description: "Returns campaigns starting *after* the given unix timestamp" })),
87
+ endTimestamp: t.Optional(t.String({ pattern: "[0-9]*", description: "Returns campaigns ending *after* the given unix timestamp" })),
88
88
  page: t.Optional(t.Numeric({ description: "0-indexed page number", default: 0 })),
89
89
  items: t.Optional(t.Numeric({ description: "Number of items returned by page", default: 20 })), // items per page
90
90
  });
@@ -199,7 +199,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
199
199
  url: string;
200
200
  description: string;
201
201
  id: string;
202
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
202
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
203
203
  icon: string;
204
204
  } | null | undefined;
205
205
  aprRecord?: {
@@ -308,7 +308,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
308
308
  url: string;
309
309
  description: string;
310
310
  id: string;
311
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
311
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
312
312
  icon: string;
313
313
  } | null | undefined;
314
314
  aprRecord?: {
@@ -129,6 +129,7 @@ export declare const OpportunityResourceDto: import("@sinclair/typebox").TObject
129
129
  ALM: "ALM";
130
130
  DEX: "DEX";
131
131
  LENDING: "LENDING";
132
+ PERPETUAL: "PERPETUAL";
132
133
  }>>;
133
134
  description: import("@sinclair/typebox").TString;
134
135
  url: import("@sinclair/typebox").TString;
@@ -144,6 +145,7 @@ export declare const OpportunityWithCampaignsResourceDto: import("@sinclair/type
144
145
  ALM: "ALM";
145
146
  DEX: "DEX";
146
147
  LENDING: "LENDING";
148
+ PERPETUAL: "PERPETUAL";
147
149
  }>>;
148
150
  description: import("@sinclair/typebox").TString;
149
151
  url: import("@sinclair/typebox").TString;
@@ -20,7 +20,7 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
20
20
  query: {
21
21
  name?: string | undefined;
22
22
  items?: number | undefined;
23
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
23
+ tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
24
24
  page?: number | undefined;
25
25
  };
26
26
  headers: unknown;
@@ -112,6 +112,7 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
112
112
  url: string;
113
113
  description: string;
114
114
  id: string;
115
+ tags: never[];
115
116
  icon: string;
116
117
  };
117
118
  params: {};
@@ -16,6 +16,7 @@ export declare const ProtocolResourceDto: import("@sinclair/typebox").TObject<{
16
16
  ALM: "ALM";
17
17
  DEX: "DEX";
18
18
  LENDING: "LENDING";
19
+ PERPETUAL: "PERPETUAL";
19
20
  }>>;
20
21
  description: import("@sinclair/typebox").TString;
21
22
  url: import("@sinclair/typebox").TString;
@@ -27,6 +28,7 @@ export declare const GetProtocolsQueryDto: import("@sinclair/typebox").TObject<{
27
28
  ALM: "ALM";
28
29
  DEX: "DEX";
29
30
  LENDING: "LENDING";
31
+ PERPETUAL: "PERPETUAL";
30
32
  }>>>;
31
33
  page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
32
34
  items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
@@ -45,6 +47,7 @@ export declare const CreateProtocolDto: import("@sinclair/typebox").TObject<{
45
47
  description: import("@sinclair/typebox").TString;
46
48
  id: import("@sinclair/typebox").TString;
47
49
  name: import("@sinclair/typebox").TString;
50
+ tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL">[]>>;
48
51
  }>;
49
52
  export declare const ProtocolIdDto: import("@sinclair/typebox").TObject<{
50
53
  id: import("@sinclair/typebox").TString;
@@ -87,5 +87,6 @@ export const CreateProtocolDto = t.Object({
87
87
  description: t.String(),
88
88
  id: t.String(),
89
89
  name: t.String(),
90
+ tags: t.Array(t.Union(Object.values(ProtocolTag).map(type => t.Literal(type)))),
90
91
  });
91
92
  export const ProtocolIdDto = t.Object({ id: t.String() });
@@ -1,7 +1,7 @@
1
- import type { GetProtocolsQueryModel, Protocol, UpdateProtocolModel } from "./protocol.model";
1
+ import type { CreateProtocolModel, GetProtocolsQueryModel, UpdateProtocolModel } from "./protocol.model";
2
2
  export declare abstract class ProtocolRepository {
3
3
  #private;
4
- static create(template: Protocol["action"]["create"]["args"]): Promise<{
4
+ static create(data: CreateProtocolModel): Promise<{
5
5
  name: string;
6
6
  url: string;
7
7
  description: string;
@@ -1,8 +1,17 @@
1
1
  import { apiDbClient } from "../../../utils/prisma";
2
2
  // ─── Protocols Repository ────────────────────────────────────────────────────
3
3
  export class ProtocolRepository {
4
- static async create(template) {
5
- return await apiDbClient.protocol.create(template);
4
+ static async create(data) {
5
+ return await apiDbClient.protocol.create({
6
+ data: {
7
+ id: data.id,
8
+ name: data.name,
9
+ icon: data.icon,
10
+ url: data.url,
11
+ description: data.description,
12
+ tags: data.tags,
13
+ },
14
+ });
6
15
  }
7
16
  static async read(type) {
8
17
  return await apiDbClient.protocol.findUnique({ where: { id: type } });
@@ -50,13 +50,7 @@ export class ProtocolService {
50
50
  return (await ProtocolRepository.findManyByName(name))[0];
51
51
  }
52
52
  static async create(data) {
53
- // let iconUri = data.icon;
54
- // if (data.iconFile) {
55
- // iconUri = await BucketService.upload("merkl-assets", `/protocols/${id}`, data.iconFile.stream(), true);
56
- // }
57
- return await ProtocolRepository.create({
58
- data,
59
- });
53
+ return await ProtocolRepository.create(data);
60
54
  }
61
55
  static async update(id, data) {
62
56
  // let iconUri = data.icon;
@@ -208,7 +208,7 @@ export declare const v4: Elysia<"/v4", false, {
208
208
  url: string;
209
209
  description: string;
210
210
  id: string;
211
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
211
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
212
212
  icon: string;
213
213
  } | null | undefined;
214
214
  aprRecord?: {
@@ -317,7 +317,7 @@ export declare const v4: Elysia<"/v4", false, {
317
317
  url: string;
318
318
  description: string;
319
319
  id: string;
320
- tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
320
+ tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
321
321
  icon: string;
322
322
  } | null | undefined;
323
323
  aprRecord?: {
@@ -734,7 +734,7 @@ export declare const v4: Elysia<"/v4", false, {
734
734
  query: {
735
735
  name?: string | undefined;
736
736
  items?: number | undefined;
737
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
737
+ tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
738
738
  page?: number | undefined;
739
739
  };
740
740
  headers: unknown;
@@ -826,6 +826,7 @@ export declare const v4: Elysia<"/v4", false, {
826
826
  url: string;
827
827
  description: string;
828
828
  id: string;
829
+ tags: never[];
829
830
  icon: string;
830
831
  };
831
832
  params: {};