@merkl/api 0.10.207 → 0.10.209
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.
- package/dist/database/api/.generated/edge.js +5 -4
- package/dist/database/api/.generated/index-browser.js +2 -1
- package/dist/database/api/.generated/index.d.ts +2 -1
- package/dist/database/api/.generated/index.js +5 -4
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +1 -0
- package/dist/database/api/.generated/wasm.js +2 -1
- package/dist/src/eden/index.d.ts +42 -9
- package/dist/src/entities/opportunity.js +1 -0
- package/dist/src/index.d.ts +16 -3
- package/dist/src/index.js +1 -1
- package/dist/src/modules/v4/campaign/campaign.model.js +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -0
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +2 -1
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +3 -0
- package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +2 -2
- package/dist/src/modules/v4/protocol/protocol.repository.js +11 -2
- package/dist/src/modules/v4/protocol/protocol.service.js +1 -7
- package/dist/src/modules/v4/router.d.ts +4 -3
- package/dist/src/utils/generateCardName.js +1 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
import type { Campaign as CampaignResource } from "../modules/v4";
|
2
2
|
import type { CampaignType } from "../../database/api/.generated";
|
3
3
|
declare const eden: {
|
4
|
+
index: {
|
5
|
+
get: (options?: {
|
6
|
+
headers?: Record<string, unknown> | undefined;
|
7
|
+
query?: Record<string, unknown> | undefined;
|
8
|
+
fetch?: RequestInit | undefined;
|
9
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
10
|
+
200: string;
|
11
|
+
}>>;
|
12
|
+
};
|
4
13
|
v1: {
|
5
14
|
allowances: {
|
6
15
|
get: (options: {
|
@@ -99,7 +108,7 @@ declare const eden: {
|
|
99
108
|
url: string;
|
100
109
|
description: string;
|
101
110
|
id: string;
|
102
|
-
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
111
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
|
103
112
|
icon: string;
|
104
113
|
} | null | undefined;
|
105
114
|
aprRecord?: {
|
@@ -199,7 +208,7 @@ declare const eden: {
|
|
199
208
|
url: string;
|
200
209
|
description: string;
|
201
210
|
id: string;
|
202
|
-
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
211
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
|
203
212
|
icon: string;
|
204
213
|
} | null | undefined;
|
205
214
|
aprRecord?: {
|
@@ -760,7 +769,7 @@ declare const eden: {
|
|
760
769
|
query: {
|
761
770
|
name?: string | undefined;
|
762
771
|
items?: number | undefined;
|
763
|
-
tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
|
772
|
+
tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
|
764
773
|
page?: number | undefined;
|
765
774
|
};
|
766
775
|
fetch?: RequestInit | undefined;
|
@@ -779,6 +788,7 @@ declare const eden: {
|
|
779
788
|
url: string;
|
780
789
|
description: string;
|
781
790
|
id: string;
|
791
|
+
tags: File | FileList;
|
782
792
|
icon: string;
|
783
793
|
}, options: {
|
784
794
|
headers: {
|
@@ -2690,6 +2700,18 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
2690
2700
|
macro: {};
|
2691
2701
|
macroFn: {};
|
2692
2702
|
}, {
|
2703
|
+
index: {
|
2704
|
+
get: {
|
2705
|
+
body: unknown;
|
2706
|
+
params: {};
|
2707
|
+
query: unknown;
|
2708
|
+
headers: unknown;
|
2709
|
+
response: {
|
2710
|
+
200: string;
|
2711
|
+
};
|
2712
|
+
};
|
2713
|
+
};
|
2714
|
+
} & {
|
2693
2715
|
v1: {
|
2694
2716
|
allowances: {
|
2695
2717
|
get: {
|
@@ -2984,7 +3006,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
2984
3006
|
url: string;
|
2985
3007
|
description: string;
|
2986
3008
|
id: string;
|
2987
|
-
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
3009
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
|
2988
3010
|
icon: string;
|
2989
3011
|
} | null | undefined;
|
2990
3012
|
aprRecord?: {
|
@@ -3093,7 +3115,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
3093
3115
|
url: string;
|
3094
3116
|
description: string;
|
3095
3117
|
id: string;
|
3096
|
-
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
3118
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
|
3097
3119
|
icon: string;
|
3098
3120
|
} | null | undefined;
|
3099
3121
|
aprRecord?: {
|
@@ -3510,7 +3532,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
3510
3532
|
query: {
|
3511
3533
|
name?: string | undefined;
|
3512
3534
|
items?: number | undefined;
|
3513
|
-
tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
|
3535
|
+
tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
|
3514
3536
|
page?: number | undefined;
|
3515
3537
|
};
|
3516
3538
|
headers: unknown;
|
@@ -3602,6 +3624,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
3602
3624
|
url: string;
|
3603
3625
|
description: string;
|
3604
3626
|
id: string;
|
3627
|
+
tags: never[];
|
3605
3628
|
icon: string;
|
3606
3629
|
};
|
3607
3630
|
params: {};
|
@@ -6021,6 +6044,15 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6021
6044
|
resolve: {};
|
6022
6045
|
schema: {};
|
6023
6046
|
}>, config?: import("@elysiajs/eden").Treaty.Config) => {
|
6047
|
+
index: {
|
6048
|
+
get: (options?: {
|
6049
|
+
headers?: Record<string, unknown> | undefined;
|
6050
|
+
query?: Record<string, unknown> | undefined;
|
6051
|
+
fetch?: RequestInit | undefined;
|
6052
|
+
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
6053
|
+
200: string;
|
6054
|
+
}>>;
|
6055
|
+
};
|
6024
6056
|
v1: {
|
6025
6057
|
allowances: {
|
6026
6058
|
get: (options: {
|
@@ -6119,7 +6151,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6119
6151
|
url: string;
|
6120
6152
|
description: string;
|
6121
6153
|
id: string;
|
6122
|
-
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
6154
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
|
6123
6155
|
icon: string;
|
6124
6156
|
} | null | undefined;
|
6125
6157
|
aprRecord?: {
|
@@ -6219,7 +6251,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6219
6251
|
url: string;
|
6220
6252
|
description: string;
|
6221
6253
|
id: string;
|
6222
|
-
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
6254
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
|
6223
6255
|
icon: string;
|
6224
6256
|
} | null | undefined;
|
6225
6257
|
aprRecord?: {
|
@@ -6780,7 +6812,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6780
6812
|
query: {
|
6781
6813
|
name?: string | undefined;
|
6782
6814
|
items?: number | undefined;
|
6783
|
-
tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
|
6815
|
+
tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
|
6784
6816
|
page?: number | undefined;
|
6785
6817
|
};
|
6786
6818
|
fetch?: RequestInit | undefined;
|
@@ -6799,6 +6831,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6799
6831
|
url: string;
|
6800
6832
|
description: string;
|
6801
6833
|
id: string;
|
6834
|
+
tags: File | FileList;
|
6802
6835
|
icon: string;
|
6803
6836
|
}, options: {
|
6804
6837
|
headers: {
|
package/dist/src/index.d.ts
CHANGED
@@ -24,6 +24,18 @@ declare const app: Elysia<"", false, {
|
|
24
24
|
macro: {};
|
25
25
|
macroFn: {};
|
26
26
|
}, {
|
27
|
+
index: {
|
28
|
+
get: {
|
29
|
+
body: unknown;
|
30
|
+
params: {};
|
31
|
+
query: unknown;
|
32
|
+
headers: unknown;
|
33
|
+
response: {
|
34
|
+
200: string;
|
35
|
+
};
|
36
|
+
};
|
37
|
+
};
|
38
|
+
} & {
|
27
39
|
v1: {
|
28
40
|
allowances: {
|
29
41
|
get: {
|
@@ -318,7 +330,7 @@ declare const app: Elysia<"", false, {
|
|
318
330
|
url: string;
|
319
331
|
description: string;
|
320
332
|
id: string;
|
321
|
-
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
333
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
|
322
334
|
icon: string;
|
323
335
|
} | null | undefined;
|
324
336
|
aprRecord?: {
|
@@ -427,7 +439,7 @@ declare const app: Elysia<"", false, {
|
|
427
439
|
url: string;
|
428
440
|
description: string;
|
429
441
|
id: string;
|
430
|
-
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
442
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[];
|
431
443
|
icon: string;
|
432
444
|
} | null | undefined;
|
433
445
|
aprRecord?: {
|
@@ -844,7 +856,7 @@ declare const app: Elysia<"", false, {
|
|
844
856
|
query: {
|
845
857
|
name?: string | undefined;
|
846
858
|
items?: number | undefined;
|
847
|
-
tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
|
859
|
+
tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
|
848
860
|
page?: number | undefined;
|
849
861
|
};
|
850
862
|
headers: unknown;
|
@@ -936,6 +948,7 @@ declare const app: Elysia<"", false, {
|
|
936
948
|
url: string;
|
937
949
|
description: string;
|
938
950
|
id: string;
|
951
|
+
tags: never[];
|
939
952
|
icon: string;
|
940
953
|
};
|
941
954
|
params: {};
|
package/dist/src/index.js
CHANGED
@@ -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]
|
87
|
-
endTimestamp: t.Optional(t.String({ pattern: "[0-9]
|
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;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import type {
|
1
|
+
import type { CreateProtocolModel, GetProtocolsQueryModel, UpdateProtocolModel } from "./protocol.model";
|
2
2
|
export declare abstract class ProtocolRepository {
|
3
3
|
#private;
|
4
|
-
static create(
|
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(
|
5
|
-
return await apiDbClient.protocol.create(
|
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
|
-
|
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: {};
|
@@ -94,6 +94,7 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""]) {
|
|
94
94
|
return `Stake ${typeInfo.symbolToken0}/${typeInfo.symbolToken1} LP on ${typeInfo.protocol}`;
|
95
95
|
case tokenType.tempest:
|
96
96
|
case tokenType.tempestStaking:
|
97
|
+
return `Deposit into ${typeInfo.symbolToken0}/${typeInfo.symbolToken1} vault on ${typeInfo.protocol}`;
|
97
98
|
case tokenType.holdstation:
|
98
99
|
return `Hold vault token ${campaign.campaignParameters.symbolTargetToken} on ${typeInfo.protocol}`;
|
99
100
|
case tokenType.staking:
|