@merkl/api 0.21.33 → 0.21.34

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prisma-client-7e7d6e095f074ae7cfafd3ca1abf380620c34ab8cc04d65d8d045130f98bf463",
2
+ "name": "prisma-client-c0e609530597e00e918aff9847ee58596f0c8dc697a79aefd68c0c9a7afa5c06",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -470,6 +470,7 @@ enum OpportunityManualOverride {
470
470
  action
471
471
  description
472
472
  howToSteps
473
+ mainProtocolId
473
474
  }
474
475
 
475
476
  enum DistributionType {
@@ -604,7 +604,8 @@ exports.OpportunityManualOverride = exports.$Enums.OpportunityManualOverride = {
604
604
  explorerAddress: 'explorerAddress',
605
605
  action: 'action',
606
606
  description: 'description',
607
- howToSteps: 'howToSteps'
607
+ howToSteps: 'howToSteps',
608
+ mainProtocolId: 'mainProtocolId'
608
609
  };
609
610
 
610
611
  exports.AprType = exports.$Enums.AprType = {
@@ -461,6 +461,36 @@ declare const eden: {
461
461
  tags: string[];
462
462
  };
463
463
  }>>;
464
+ patch: (body: {
465
+ tags?: string[] | undefined;
466
+ }, options: {
467
+ headers: {
468
+ authorization: string;
469
+ };
470
+ query?: Record<string, unknown> | undefined;
471
+ fetch?: RequestInit | undefined;
472
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
473
+ 200: {
474
+ status: import("@db/api").$Enums.Status;
475
+ type: string;
476
+ name: string;
477
+ description: string;
478
+ id: string;
479
+ tags: string[];
480
+ identifier: string;
481
+ action: import("@db/api").$Enums.OpportunityAction;
482
+ manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
483
+ chainId: number;
484
+ howToSteps: string[];
485
+ depositUrl: string | null;
486
+ explorerAddress: string | null;
487
+ mainProtocolId: string | null;
488
+ tvl: number;
489
+ apr: number;
490
+ dailyRewards: number;
491
+ lastCampaignCreatedAt: Date;
492
+ };
493
+ }>>;
464
494
  override: {
465
495
  patch: (body: {
466
496
  name?: string | undefined;
@@ -469,6 +499,7 @@ declare const eden: {
469
499
  howToSteps?: string[] | undefined;
470
500
  depositUrl?: string | undefined;
471
501
  explorerAddress?: string | undefined;
502
+ mainProtocolId?: string | undefined;
472
503
  }, options: {
473
504
  headers: {
474
505
  authorization: string;
@@ -497,7 +528,7 @@ declare const eden: {
497
528
  lastCampaignCreatedAt: Date;
498
529
  };
499
530
  }>>;
500
- delete: (body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress")[], options: {
531
+ delete: (body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress" | "mainProtocolId")[], options: {
501
532
  headers: {
502
533
  authorization: string;
503
534
  };
@@ -6881,6 +6912,45 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6881
6912
  };
6882
6913
  };
6883
6914
  };
6915
+ } & {
6916
+ opportunities: {
6917
+ ":id": {
6918
+ patch: {
6919
+ body: {
6920
+ tags?: string[] | undefined;
6921
+ };
6922
+ params: {
6923
+ id: string;
6924
+ };
6925
+ query: unknown;
6926
+ headers: {
6927
+ authorization: string;
6928
+ };
6929
+ response: {
6930
+ 200: {
6931
+ status: import("@db/api").$Enums.Status;
6932
+ type: string;
6933
+ name: string;
6934
+ description: string;
6935
+ id: string;
6936
+ tags: string[];
6937
+ identifier: string;
6938
+ action: import("@db/api").$Enums.OpportunityAction;
6939
+ manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
6940
+ chainId: number;
6941
+ howToSteps: string[];
6942
+ depositUrl: string | null;
6943
+ explorerAddress: string | null;
6944
+ mainProtocolId: string | null;
6945
+ tvl: number;
6946
+ apr: number;
6947
+ dailyRewards: number;
6948
+ lastCampaignCreatedAt: Date;
6949
+ };
6950
+ };
6951
+ };
6952
+ };
6953
+ };
6884
6954
  } & {
6885
6955
  opportunities: {
6886
6956
  ":id": {
@@ -6893,6 +6963,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6893
6963
  howToSteps?: string[] | undefined;
6894
6964
  depositUrl?: string | undefined;
6895
6965
  explorerAddress?: string | undefined;
6966
+ mainProtocolId?: string | undefined;
6896
6967
  };
6897
6968
  params: {
6898
6969
  id: string;
@@ -6932,7 +7003,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6932
7003
  ":id": {
6933
7004
  override: {
6934
7005
  delete: {
6935
- body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress")[];
7006
+ body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress" | "mainProtocolId")[];
6936
7007
  params: {
6937
7008
  id: string;
6938
7009
  };
@@ -12953,6 +13024,36 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12953
13024
  tags: string[];
12954
13025
  };
12955
13026
  }>>;
13027
+ patch: (body: {
13028
+ tags?: string[] | undefined;
13029
+ }, options: {
13030
+ headers: {
13031
+ authorization: string;
13032
+ };
13033
+ query?: Record<string, unknown> | undefined;
13034
+ fetch?: RequestInit | undefined;
13035
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13036
+ 200: {
13037
+ status: import("@db/api").$Enums.Status;
13038
+ type: string;
13039
+ name: string;
13040
+ description: string;
13041
+ id: string;
13042
+ tags: string[];
13043
+ identifier: string;
13044
+ action: import("@db/api").$Enums.OpportunityAction;
13045
+ manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
13046
+ chainId: number;
13047
+ howToSteps: string[];
13048
+ depositUrl: string | null;
13049
+ explorerAddress: string | null;
13050
+ mainProtocolId: string | null;
13051
+ tvl: number;
13052
+ apr: number;
13053
+ dailyRewards: number;
13054
+ lastCampaignCreatedAt: Date;
13055
+ };
13056
+ }>>;
12956
13057
  override: {
12957
13058
  patch: (body: {
12958
13059
  name?: string | undefined;
@@ -12961,6 +13062,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12961
13062
  howToSteps?: string[] | undefined;
12962
13063
  depositUrl?: string | undefined;
12963
13064
  explorerAddress?: string | undefined;
13065
+ mainProtocolId?: string | undefined;
12964
13066
  }, options: {
12965
13067
  headers: {
12966
13068
  authorization: string;
@@ -12989,7 +13091,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12989
13091
  lastCampaignCreatedAt: Date;
12990
13092
  };
12991
13093
  }>>;
12992
- delete: (body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress")[], options: {
13094
+ delete: (body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress" | "mainProtocolId")[], options: {
12993
13095
  headers: {
12994
13096
  authorization: string;
12995
13097
  };
@@ -1280,6 +1280,45 @@ declare const app: Elysia<"", false, {
1280
1280
  };
1281
1281
  };
1282
1282
  };
1283
+ } & {
1284
+ opportunities: {
1285
+ ":id": {
1286
+ patch: {
1287
+ body: {
1288
+ tags?: string[] | undefined;
1289
+ };
1290
+ params: {
1291
+ id: string;
1292
+ };
1293
+ query: unknown;
1294
+ headers: {
1295
+ authorization: string;
1296
+ };
1297
+ response: {
1298
+ 200: {
1299
+ status: import("@db/api").$Enums.Status;
1300
+ type: string;
1301
+ name: string;
1302
+ description: string;
1303
+ id: string;
1304
+ tags: string[];
1305
+ identifier: string;
1306
+ action: import("@db/api").$Enums.OpportunityAction;
1307
+ manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
1308
+ chainId: number;
1309
+ howToSteps: string[];
1310
+ depositUrl: string | null;
1311
+ explorerAddress: string | null;
1312
+ mainProtocolId: string | null;
1313
+ tvl: number;
1314
+ apr: number;
1315
+ dailyRewards: number;
1316
+ lastCampaignCreatedAt: Date;
1317
+ };
1318
+ };
1319
+ };
1320
+ };
1321
+ };
1283
1322
  } & {
1284
1323
  opportunities: {
1285
1324
  ":id": {
@@ -1292,6 +1331,7 @@ declare const app: Elysia<"", false, {
1292
1331
  howToSteps?: string[] | undefined;
1293
1332
  depositUrl?: string | undefined;
1294
1333
  explorerAddress?: string | undefined;
1334
+ mainProtocolId?: string | undefined;
1295
1335
  };
1296
1336
  params: {
1297
1337
  id: string;
@@ -1331,7 +1371,7 @@ declare const app: Elysia<"", false, {
1331
1371
  ":id": {
1332
1372
  override: {
1333
1373
  delete: {
1334
- body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress")[];
1374
+ body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress" | "mainProtocolId")[];
1335
1375
  params: {
1336
1376
  id: string;
1337
1377
  };
@@ -1135,6 +1135,45 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
1135
1135
  };
1136
1136
  };
1137
1137
  };
1138
+ } & {
1139
+ opportunities: {
1140
+ ":id": {
1141
+ patch: {
1142
+ body: {
1143
+ tags?: string[] | undefined;
1144
+ };
1145
+ params: {
1146
+ id: string;
1147
+ };
1148
+ query: unknown;
1149
+ headers: {
1150
+ authorization: string;
1151
+ };
1152
+ response: {
1153
+ 200: {
1154
+ status: import("@db/api").$Enums.Status;
1155
+ type: string;
1156
+ name: string;
1157
+ description: string;
1158
+ id: string;
1159
+ tags: string[];
1160
+ identifier: string;
1161
+ action: import("@db/api").$Enums.OpportunityAction;
1162
+ manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
1163
+ chainId: number;
1164
+ howToSteps: string[];
1165
+ depositUrl: string | null;
1166
+ explorerAddress: string | null;
1167
+ mainProtocolId: string | null;
1168
+ tvl: number;
1169
+ apr: number;
1170
+ dailyRewards: number;
1171
+ lastCampaignCreatedAt: Date;
1172
+ };
1173
+ };
1174
+ };
1175
+ };
1176
+ };
1138
1177
  } & {
1139
1178
  opportunities: {
1140
1179
  ":id": {
@@ -1147,6 +1186,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
1147
1186
  howToSteps?: string[] | undefined;
1148
1187
  depositUrl?: string | undefined;
1149
1188
  explorerAddress?: string | undefined;
1189
+ mainProtocolId?: string | undefined;
1150
1190
  };
1151
1191
  params: {
1152
1192
  id: string;
@@ -1186,7 +1226,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
1186
1226
  ":id": {
1187
1227
  override: {
1188
1228
  delete: {
1189
- body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress")[];
1229
+ body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress" | "mainProtocolId")[];
1190
1230
  params: {
1191
1231
  id: string;
1192
1232
  };
@@ -1287,7 +1327,9 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
1287
1327
  authorization: string;
1288
1328
  };
1289
1329
  query: unknown;
1290
- params: unknown;
1330
+ params: {
1331
+ id: string;
1332
+ };
1291
1333
  cookie: unknown;
1292
1334
  response: {};
1293
1335
  };
@@ -6,7 +6,7 @@ import { log } from "@/utils/logger";
6
6
  import { throwOnUnsupportedActionList } from "@/utils/throw";
7
7
  import { ChainId } from "@sdk";
8
8
  import Elysia, { t } from "elysia";
9
- import { CreateOpportunityDto, GetOpportunitiesQueryDto, GetOpportunityQueryDto, OpportunityAggregateFieldDto, OpportunityDeleteOverrideDto, OpportunityOverrideDto, OpportunityResourceDto, OpportunityUniqueDto, OpportunityUniqueUpdateDto, OpportunityWithCampaignsResourceDto, } from "./opportunity.model";
9
+ import { CreateOpportunityDto, GetOpportunitiesQueryDto, GetOpportunityQueryDto, OpportunityAggregateFieldDto, OpportunityDeleteOverrideDto, OpportunityOverrideDto, OpportunityResourceDto, OpportunityUniqueDto, OpportunityUniqueUpdateDto, OpportunityWithCampaignsResourceDto, UpdateOpportunityDto, } from "./opportunity.model";
10
10
  import { OpportunityService } from "./opportunity.service";
11
11
  import { transformId } from "./transform-id.pipe";
12
12
  import { validateId } from "./validate-id.pipe";
@@ -177,11 +177,13 @@ export const OpportunityController = new Elysia({
177
177
  }
178
178
  }, { params: OpportunityUniqueUpdateDto })
179
179
  // ─── Override An Opportunity Field ───────────────────────────────────
180
+ .guard({ params: OpportunityUniqueDto })
181
+ .patch("/:id", async ({ params, body }) => await OpportunityService.update(params.id, body), {
182
+ body: UpdateOpportunityDto,
183
+ })
180
184
  .patch("/:id/override", async ({ params, body }) => await OpportunityService.override(params.id, body), {
181
- params: OpportunityUniqueDto,
182
185
  body: OpportunityOverrideDto,
183
186
  })
184
187
  .delete("/:id/override", async ({ params, body }) => await OpportunityService.deleteOverrides(params.id, body), {
185
- params: OpportunityUniqueDto,
186
188
  body: OpportunityDeleteOverrideDto,
187
189
  });
@@ -388,6 +388,7 @@ export declare const OpportunityOverrideDto: import("@sinclair/typebox").TObject
388
388
  SWAP: "SWAP";
389
389
  INVALID: "INVALID";
390
390
  }>>;
391
+ mainProtocolId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
391
392
  }>;
392
393
  export declare const OpportunityDeleteOverrideDto: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TEnum<{
393
394
  name: "name";
@@ -396,7 +397,11 @@ export declare const OpportunityDeleteOverrideDto: import("@sinclair/typebox").T
396
397
  action: "action";
397
398
  description: "description";
398
399
  howToSteps: "howToSteps";
400
+ mainProtocolId: "mainProtocolId";
399
401
  }>>;
402
+ export declare const UpdateOpportunityDto: import("@sinclair/typebox").TObject<{
403
+ tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
404
+ }>;
400
405
  export type GetOpportunitiesQueryModel = typeof GetOpportunitiesQueryDto.static;
401
406
  export type GetOpportunityQueryModel = typeof GetOpportunityQueryDto.static;
402
407
  export type CreateOpportunityModel = typeof CreateOpportunityDto.static;
@@ -124,5 +124,9 @@ export const OpportunityOverrideDto = t.Object({
124
124
  depositUrl: t.Optional(t.String({ format: "uri" })),
125
125
  explorerAddress: t.Optional(t.String({ format: "uri" })),
126
126
  action: t.Optional(t.Enum(OpportunityAction)),
127
+ mainProtocolId: t.Optional(t.String()),
127
128
  });
128
129
  export const OpportunityDeleteOverrideDto = t.Array(t.Enum(OpportunityManualOverride));
130
+ export const UpdateOpportunityDto = t.Object({
131
+ tags: t.Optional(t.Array(t.String())),
132
+ });
@@ -1150,6 +1150,45 @@ export declare const v4: Elysia<"/v4", false, {
1150
1150
  };
1151
1151
  };
1152
1152
  };
1153
+ } & {
1154
+ opportunities: {
1155
+ ":id": {
1156
+ patch: {
1157
+ body: {
1158
+ tags?: string[] | undefined;
1159
+ };
1160
+ params: {
1161
+ id: string;
1162
+ };
1163
+ query: unknown;
1164
+ headers: {
1165
+ authorization: string;
1166
+ };
1167
+ response: {
1168
+ 200: {
1169
+ status: import("@db/api").$Enums.Status;
1170
+ type: string;
1171
+ name: string;
1172
+ description: string;
1173
+ id: string;
1174
+ tags: string[];
1175
+ identifier: string;
1176
+ action: import("@db/api").$Enums.OpportunityAction;
1177
+ manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
1178
+ chainId: number;
1179
+ howToSteps: string[];
1180
+ depositUrl: string | null;
1181
+ explorerAddress: string | null;
1182
+ mainProtocolId: string | null;
1183
+ tvl: number;
1184
+ apr: number;
1185
+ dailyRewards: number;
1186
+ lastCampaignCreatedAt: Date;
1187
+ };
1188
+ };
1189
+ };
1190
+ };
1191
+ };
1153
1192
  } & {
1154
1193
  opportunities: {
1155
1194
  ":id": {
@@ -1162,6 +1201,7 @@ export declare const v4: Elysia<"/v4", false, {
1162
1201
  howToSteps?: string[] | undefined;
1163
1202
  depositUrl?: string | undefined;
1164
1203
  explorerAddress?: string | undefined;
1204
+ mainProtocolId?: string | undefined;
1165
1205
  };
1166
1206
  params: {
1167
1207
  id: string;
@@ -1201,7 +1241,7 @@ export declare const v4: Elysia<"/v4", false, {
1201
1241
  ":id": {
1202
1242
  override: {
1203
1243
  delete: {
1204
- body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress")[];
1244
+ body: ("name" | "description" | "action" | "howToSteps" | "depositUrl" | "explorerAddress" | "mainProtocolId")[];
1205
1245
  params: {
1206
1246
  id: string;
1207
1247
  };