@merkl/api 0.16.1 → 0.16.2
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/drizzle/schema.d.ts +8 -9
- package/dist/database/api/.generated/drizzle/schema.js +2 -3
- package/dist/database/api/.generated/drizzle/schema.ts +2 -4
- package/dist/database/api/.generated/edge.js +5 -33
- package/dist/database/api/.generated/index-browser.js +2 -30
- package/dist/database/api/.generated/index.d.ts +123 -210
- package/dist/database/api/.generated/index.js +5 -33
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +2 -32
- package/dist/database/api/.generated/wasm.js +2 -30
- package/dist/src/constants.d.ts +259 -13
- package/dist/src/eden/index.d.ts +98 -98
- package/dist/src/index.d.ts +19 -19
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +6 -6
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +5 -65
- package/dist/src/modules/v4/campaign/campaign.model.js +1 -34
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +7 -7
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +14 -15
- package/dist/src/modules/v4/campaign/campaign.service.js +6 -6
- package/dist/src/modules/v4/chain/chain.repository.d.ts +1 -1
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +2 -2
- package/dist/src/modules/v4/dynamicData/dynamicData.model.d.ts +2 -58
- package/dist/src/modules/v4/dynamicData/dynamicData.model.js +2 -3
- package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +1 -8
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +4 -13
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +9 -9
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +3 -31
- package/dist/src/modules/v4/opportunity/opportunity.model.js +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +33 -18
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +9 -1
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +15 -15
- package/dist/src/modules/v4/opportunity/opportunity.service.js +3 -2
- package/dist/src/modules/v4/opportunity/subservices/getErc20Metadata.service.d.ts +1 -1
- package/dist/src/modules/v4/opportunity/subservices/getErc20Metadata.service.js +2 -2
- package/dist/src/modules/v4/opportunity/subservices/getEulerMetadata.service.d.ts +1 -1
- package/dist/src/modules/v4/opportunity/subservices/getEulerMetadata.service.js +3 -2
- package/dist/src/modules/v4/opportunity/validate-id.pipe.js +3 -3
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +2 -2
- package/dist/src/modules/v4/reward/reward.repository.d.ts +1 -1
- package/dist/src/modules/v4/reward/reward.service.d.ts +8 -8
- package/dist/src/modules/v4/reward/reward.service.js +2 -2
- package/dist/src/modules/v4/router.d.ts +19 -19
- package/dist/src/modules/v4/user/user.controller.d.ts +2 -2
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
@@ -166,7 +166,7 @@ declare const app: Elysia<"", false, {
|
|
166
166
|
depositUrl?: string | undefined;
|
167
167
|
protocols?: string[] | undefined;
|
168
168
|
mainProtocol?: string | undefined;
|
169
|
-
type:
|
169
|
+
type: string;
|
170
170
|
tokens: {
|
171
171
|
chainId: number;
|
172
172
|
address: string;
|
@@ -174,7 +174,7 @@ declare const app: Elysia<"", false, {
|
|
174
174
|
status: "NONE" | "PAST" | "LIVE" | "SOON";
|
175
175
|
identifier: string;
|
176
176
|
chainId: number;
|
177
|
-
action: "
|
177
|
+
action: "POOL" | "HOLD" | "DROP" | "LEND" | "BORROW" | "LONG" | "SHORT" | "INVALID";
|
178
178
|
};
|
179
179
|
params: {};
|
180
180
|
query: unknown;
|
@@ -184,7 +184,7 @@ declare const app: Elysia<"", false, {
|
|
184
184
|
response: {
|
185
185
|
200: {
|
186
186
|
name: string;
|
187
|
-
type:
|
187
|
+
type: string;
|
188
188
|
id: string;
|
189
189
|
status: import("../database/api/.generated").$Enums.Status;
|
190
190
|
tags: string[];
|
@@ -218,7 +218,7 @@ declare const app: Elysia<"", false, {
|
|
218
218
|
200: {
|
219
219
|
id: string;
|
220
220
|
chainId: number;
|
221
|
-
type:
|
221
|
+
type: string;
|
222
222
|
identifier: string;
|
223
223
|
name: string;
|
224
224
|
status: "PAST" | "LIVE" | "SOON";
|
@@ -348,7 +348,7 @@ declare const app: Elysia<"", false, {
|
|
348
348
|
icon: string;
|
349
349
|
} | undefined;
|
350
350
|
name: string;
|
351
|
-
type:
|
351
|
+
type: string;
|
352
352
|
status: import("../database/api/.generated").$Enums.Status;
|
353
353
|
tags: string[];
|
354
354
|
identifier: string;
|
@@ -509,7 +509,7 @@ declare const app: Elysia<"", false, {
|
|
509
509
|
body: unknown;
|
510
510
|
params: {};
|
511
511
|
query: {
|
512
|
-
type?:
|
512
|
+
type?: string | undefined;
|
513
513
|
items?: number | undefined;
|
514
514
|
subType?: number | undefined;
|
515
515
|
page?: number | undefined;
|
@@ -646,12 +646,13 @@ declare const app: Elysia<"", false, {
|
|
646
646
|
computedUntil: bigint;
|
647
647
|
processingStarted: bigint;
|
648
648
|
};
|
649
|
+
creatorAddress: string;
|
649
650
|
Creator: {
|
650
651
|
tags: string[];
|
651
652
|
address: string;
|
652
653
|
creatorId: string | null;
|
653
654
|
};
|
654
|
-
type:
|
655
|
+
type: string;
|
655
656
|
id: string;
|
656
657
|
subType: number | null;
|
657
658
|
startTimestamp: bigint;
|
@@ -662,7 +663,6 @@ declare const app: Elysia<"", false, {
|
|
662
663
|
rewardTokenId: string;
|
663
664
|
amount: string;
|
664
665
|
opportunityId: string;
|
665
|
-
creatorAddress: string;
|
666
666
|
}[];
|
667
667
|
})[];
|
668
668
|
readonly 404: {
|
@@ -966,7 +966,7 @@ declare const app: Elysia<"", false, {
|
|
966
966
|
response: {
|
967
967
|
200: {
|
968
968
|
name: string;
|
969
|
-
type:
|
969
|
+
type: string;
|
970
970
|
id: string;
|
971
971
|
status: import("../database/api/.generated").$Enums.Status;
|
972
972
|
tags: string[];
|
@@ -1012,7 +1012,7 @@ declare const app: Elysia<"", false, {
|
|
1012
1012
|
};
|
1013
1013
|
response: {
|
1014
1014
|
200: {
|
1015
|
-
type:
|
1015
|
+
type: string;
|
1016
1016
|
id: string;
|
1017
1017
|
params: import("database/api/.generated/runtime/library").JsonValue;
|
1018
1018
|
subType: number | null;
|
@@ -1063,7 +1063,7 @@ declare const app: Elysia<"", false, {
|
|
1063
1063
|
};
|
1064
1064
|
response: {
|
1065
1065
|
200: {
|
1066
|
-
type:
|
1066
|
+
type: string;
|
1067
1067
|
id: string;
|
1068
1068
|
params: import("database/api/.generated/runtime/library").JsonValue;
|
1069
1069
|
subType: number | null;
|
@@ -1086,7 +1086,7 @@ declare const app: Elysia<"", false, {
|
|
1086
1086
|
body: unknown;
|
1087
1087
|
params: {};
|
1088
1088
|
query: {
|
1089
|
-
type?:
|
1089
|
+
type?: string | undefined;
|
1090
1090
|
items?: number | undefined;
|
1091
1091
|
subType?: number | undefined;
|
1092
1092
|
page?: number | undefined;
|
@@ -1138,12 +1138,13 @@ declare const app: Elysia<"", false, {
|
|
1138
1138
|
computedUntil: bigint;
|
1139
1139
|
processingStarted: bigint;
|
1140
1140
|
};
|
1141
|
+
creatorAddress: string;
|
1141
1142
|
Creator: {
|
1142
1143
|
tags: string[];
|
1143
1144
|
address: string;
|
1144
1145
|
creatorId: string | null;
|
1145
1146
|
};
|
1146
|
-
type:
|
1147
|
+
type: string;
|
1147
1148
|
id: string;
|
1148
1149
|
subType: number | null;
|
1149
1150
|
startTimestamp: bigint;
|
@@ -1154,7 +1155,6 @@ declare const app: Elysia<"", false, {
|
|
1154
1155
|
rewardTokenId: string;
|
1155
1156
|
amount: string;
|
1156
1157
|
opportunityId: string;
|
1157
|
-
creatorAddress: string;
|
1158
1158
|
}[];
|
1159
1159
|
};
|
1160
1160
|
};
|
@@ -1165,7 +1165,7 @@ declare const app: Elysia<"", false, {
|
|
1165
1165
|
body: unknown;
|
1166
1166
|
params: {};
|
1167
1167
|
query: {
|
1168
|
-
type?:
|
1168
|
+
type?: string | undefined;
|
1169
1169
|
items?: number | undefined;
|
1170
1170
|
subType?: number | undefined;
|
1171
1171
|
page?: number | undefined;
|
@@ -2547,7 +2547,7 @@ declare const app: Elysia<"", false, {
|
|
2547
2547
|
} | null;
|
2548
2548
|
} & {
|
2549
2549
|
name: string;
|
2550
|
-
type:
|
2550
|
+
type: string;
|
2551
2551
|
id: string;
|
2552
2552
|
status: import("../database/api/.generated").$Enums.Status;
|
2553
2553
|
tags: string[];
|
@@ -2660,7 +2660,7 @@ declare const app: Elysia<"", false, {
|
|
2660
2660
|
} | null;
|
2661
2661
|
} & {
|
2662
2662
|
name: string;
|
2663
|
-
type:
|
2663
|
+
type: string;
|
2664
2664
|
id: string;
|
2665
2665
|
status: import("../database/api/.generated").$Enums.Status;
|
2666
2666
|
tags: string[];
|
@@ -3166,7 +3166,7 @@ declare const app: Elysia<"", false, {
|
|
3166
3166
|
rewardTokenAddress?: string | undefined;
|
3167
3167
|
distributionChain?: {} | undefined;
|
3168
3168
|
opportunityIdentifier?: string | undefined;
|
3169
|
-
type:
|
3169
|
+
type: string;
|
3170
3170
|
params: {};
|
3171
3171
|
computeChainId: number;
|
3172
3172
|
};
|
@@ -3188,7 +3188,7 @@ declare const app: Elysia<"", false, {
|
|
3188
3188
|
body: unknown;
|
3189
3189
|
params: {};
|
3190
3190
|
query: {
|
3191
|
-
type?:
|
3191
|
+
type?: string | undefined;
|
3192
3192
|
items?: number | undefined;
|
3193
3193
|
subType?: number | undefined;
|
3194
3194
|
page?: number | undefined;
|
@@ -38,7 +38,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
38
38
|
};
|
39
39
|
response: {
|
40
40
|
200: {
|
41
|
-
type:
|
41
|
+
type: string;
|
42
42
|
id: string;
|
43
43
|
params: import("database/api/.generated/runtime/library").JsonValue;
|
44
44
|
subType: number | null;
|
@@ -89,7 +89,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
89
89
|
};
|
90
90
|
response: {
|
91
91
|
200: {
|
92
|
-
type:
|
92
|
+
type: string;
|
93
93
|
id: string;
|
94
94
|
params: import("database/api/.generated/runtime/library").JsonValue;
|
95
95
|
subType: number | null;
|
@@ -112,7 +112,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
112
112
|
body: unknown;
|
113
113
|
params: {};
|
114
114
|
query: {
|
115
|
-
type?:
|
115
|
+
type?: string | undefined;
|
116
116
|
items?: number | undefined;
|
117
117
|
subType?: number | undefined;
|
118
118
|
page?: number | undefined;
|
@@ -164,12 +164,13 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
164
164
|
computedUntil: bigint;
|
165
165
|
processingStarted: bigint;
|
166
166
|
};
|
167
|
+
creatorAddress: string;
|
167
168
|
Creator: {
|
168
169
|
tags: string[];
|
169
170
|
address: string;
|
170
171
|
creatorId: string | null;
|
171
172
|
};
|
172
|
-
type:
|
173
|
+
type: string;
|
173
174
|
id: string;
|
174
175
|
subType: number | null;
|
175
176
|
startTimestamp: bigint;
|
@@ -180,7 +181,6 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
180
181
|
rewardTokenId: string;
|
181
182
|
amount: string;
|
182
183
|
opportunityId: string;
|
183
|
-
creatorAddress: string;
|
184
184
|
}[];
|
185
185
|
};
|
186
186
|
};
|
@@ -191,7 +191,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
191
191
|
body: unknown;
|
192
192
|
params: {};
|
193
193
|
query: {
|
194
|
-
type?:
|
194
|
+
type?: string | undefined;
|
195
195
|
items?: number | undefined;
|
196
196
|
subType?: number | undefined;
|
197
197
|
page?: number | undefined;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { Resource } from "../prisma";
|
2
2
|
import { type Token } from "../token";
|
3
|
-
import {
|
4
|
-
import { type CampaignParameters } from "@sdk";
|
3
|
+
import type { Campaign as CampaignEnum, CampaignParameters } from "@sdk";
|
5
4
|
import { type Chain } from "../chain/chain.model";
|
6
5
|
import { type Status } from "../status/status.model";
|
7
6
|
/**
|
@@ -9,46 +8,15 @@ import { type Status } from "../status/status.model";
|
|
9
8
|
* @description Target description of rewards campaigns
|
10
9
|
* @see {@link Resource}
|
11
10
|
*/
|
12
|
-
export type Campaign
|
11
|
+
export type Campaign = Resource<"Campaign", "opportunityId" | "rewardTokenId" | "params", {
|
13
12
|
chain: Chain["model"];
|
14
13
|
rewardToken: Token["model"];
|
15
14
|
distributionChain?: Chain["model"];
|
16
15
|
campaignStatus?: Status["model"];
|
17
16
|
}>;
|
18
|
-
export type CampaignWithParams<C extends
|
19
|
-
params: CampaignParameters<
|
17
|
+
export type CampaignWithParams<C extends CampaignEnum = CampaignEnum> = Campaign & Resource<"Campaign", "opportunityId" | "rewardTokenId" | (keyof Campaign["model"] & keyof Resource<"Campaign">), {
|
18
|
+
params: CampaignParameters<C>["campaignParameters"];
|
20
19
|
}>;
|
21
|
-
export declare const campaignTypeToEnumMap: {
|
22
|
-
readonly INVALID: any;
|
23
|
-
readonly CLAMM: any;
|
24
|
-
readonly ERC20: any;
|
25
|
-
readonly BADGER: any;
|
26
|
-
readonly AJNA: any;
|
27
|
-
readonly COMPOUND: any;
|
28
|
-
readonly EULER: any;
|
29
|
-
readonly DOLOMITE: any;
|
30
|
-
readonly ERC20_SNAPSHOT: any;
|
31
|
-
readonly MORPHO: any;
|
32
|
-
readonly RADIANT: any;
|
33
|
-
readonly SILO: any;
|
34
|
-
readonly JSON_AIRDROP: any;
|
35
|
-
readonly UNISWAP_V4: any;
|
36
|
-
readonly EIGENLAYER: any;
|
37
|
-
readonly VEST: any;
|
38
|
-
readonly ERC20LOGPROCESSOR: any;
|
39
|
-
readonly ERC20REBASELOGPROCESSOR: any;
|
40
|
-
readonly ION: any;
|
41
|
-
readonly ERC20TRANSFERS: any;
|
42
|
-
readonly ERC20_FIX_APR: any;
|
43
|
-
readonly HYPERDRIVELOGPROCESSOR: any;
|
44
|
-
readonly HYPERDRIVELOGFIXPROCESSOR: any;
|
45
|
-
readonly AMBIENTPROCESSOR: any;
|
46
|
-
readonly M0: any;
|
47
|
-
readonly MORPHOSUPPLY: any;
|
48
|
-
readonly SYNCSWAP_VAULT: any;
|
49
|
-
readonly UNISWAP_V4_LP: any;
|
50
|
-
};
|
51
|
-
export type ConvertedCampaignType<C extends CampaignType> = (typeof campaignTypeToEnumMap)[C];
|
52
20
|
export declare const CampaignUniqueDto: import("@sinclair/typebox").TObject<{
|
53
21
|
distributionChain: import("@sinclair/typebox").TNumber;
|
54
22
|
campaignId: import("@sinclair/typebox").TString;
|
@@ -130,35 +98,7 @@ export declare const GetCampaignQueryDto: import("@sinclair/typebox").TObject<{
|
|
130
98
|
creatorAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
131
99
|
creatorId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
132
100
|
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
133
|
-
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
134
|
-
INVALID: "INVALID";
|
135
|
-
ERC20: "ERC20";
|
136
|
-
CLAMM: "CLAMM";
|
137
|
-
ERC20_SNAPSHOT: "ERC20_SNAPSHOT";
|
138
|
-
JSON_AIRDROP: "JSON_AIRDROP";
|
139
|
-
SILO: "SILO";
|
140
|
-
RADIANT: "RADIANT";
|
141
|
-
MORPHO: "MORPHO";
|
142
|
-
DOLOMITE: "DOLOMITE";
|
143
|
-
BADGER: "BADGER";
|
144
|
-
COMPOUND: "COMPOUND";
|
145
|
-
AJNA: "AJNA";
|
146
|
-
EULER: "EULER";
|
147
|
-
UNISWAP_V4: "UNISWAP_V4";
|
148
|
-
ION: "ION";
|
149
|
-
EIGENLAYER: "EIGENLAYER";
|
150
|
-
ERC20TRANSFERS: "ERC20TRANSFERS";
|
151
|
-
ERC20LOGPROCESSOR: "ERC20LOGPROCESSOR";
|
152
|
-
ERC20REBASELOGPROCESSOR: "ERC20REBASELOGPROCESSOR";
|
153
|
-
VEST: "VEST";
|
154
|
-
ERC20_FIX_APR: "ERC20_FIX_APR";
|
155
|
-
HYPERDRIVELOGPROCESSOR: "HYPERDRIVELOGPROCESSOR";
|
156
|
-
HYPERDRIVELOGFIXPROCESSOR: "HYPERDRIVELOGFIXPROCESSOR";
|
157
|
-
AMBIENTPROCESSOR: "AMBIENTPROCESSOR";
|
158
|
-
M0: "M0";
|
159
|
-
MORPHOSUPPLY: "MORPHOSUPPLY";
|
160
|
-
SYNCSWAP_VAULT: "SYNCSWAP_VAULT";
|
161
|
-
}>>;
|
101
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
162
102
|
subType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
163
103
|
campaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
164
104
|
mainParameter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
@@ -1,40 +1,7 @@
|
|
1
1
|
import { TokenResourceDto } from "../token";
|
2
|
-
import { CampaignType } from "../../../../database/api/.generated";
|
3
|
-
import { Campaign as CampaignTypeEnum } from "@sdk";
|
4
2
|
import { t } from "elysia";
|
5
3
|
import { ChainResourceDto } from "../chain/chain.model";
|
6
4
|
import { CampaignStatusResourceDto } from "../status/status.model";
|
7
|
-
// ─── Utils ───────────────────────────────────────────────────────────────────
|
8
|
-
export const campaignTypeToEnumMap = {
|
9
|
-
INVALID: CampaignTypeEnum.INVALID,
|
10
|
-
CLAMM: CampaignTypeEnum.CLAMM,
|
11
|
-
ERC20: CampaignTypeEnum.ERC20,
|
12
|
-
BADGER: CampaignTypeEnum.BADGER,
|
13
|
-
AJNA: CampaignTypeEnum.AJNA,
|
14
|
-
COMPOUND: CampaignTypeEnum.COMPOUND,
|
15
|
-
EULER: CampaignTypeEnum.EULER,
|
16
|
-
DOLOMITE: CampaignTypeEnum.DOLOMITE,
|
17
|
-
ERC20_SNAPSHOT: CampaignTypeEnum.ERC20_SNAPSHOT,
|
18
|
-
MORPHO: CampaignTypeEnum.MORPHO,
|
19
|
-
RADIANT: CampaignTypeEnum.RADIANT,
|
20
|
-
SILO: CampaignTypeEnum.SILO,
|
21
|
-
JSON_AIRDROP: CampaignTypeEnum.JSON_AIRDROP,
|
22
|
-
UNISWAP_V4: CampaignTypeEnum.UNISWAP_V4,
|
23
|
-
EIGENLAYER: CampaignTypeEnum.EIGENLAYER,
|
24
|
-
VEST: CampaignTypeEnum.VEST,
|
25
|
-
ERC20LOGPROCESSOR: CampaignTypeEnum.ERC20LOGPROCESSOR,
|
26
|
-
ERC20REBASELOGPROCESSOR: CampaignTypeEnum.ERC20REBASELOGPROCESSOR,
|
27
|
-
ION: CampaignTypeEnum.ION,
|
28
|
-
ERC20TRANSFERS: CampaignTypeEnum.ERC20TRANSFERS,
|
29
|
-
ERC20_FIX_APR: CampaignTypeEnum.ERC20_FIX_APR,
|
30
|
-
HYPERDRIVELOGPROCESSOR: CampaignTypeEnum.HYPERDRIVELOGPROCESSOR,
|
31
|
-
HYPERDRIVELOGFIXPROCESSOR: CampaignTypeEnum.HYPERDRIVELOGFIXPROCESSOR,
|
32
|
-
AMBIENTPROCESSOR: CampaignTypeEnum.AMBIENTPROCESSOR,
|
33
|
-
M0: CampaignTypeEnum.M0,
|
34
|
-
MORPHOSUPPLY: CampaignTypeEnum.MORPHOSUPPLY,
|
35
|
-
SYNCSWAP_VAULT: CampaignTypeEnum.SYNCSWAP_VAULT,
|
36
|
-
UNISWAP_V4_LP: CampaignTypeEnum.UNISWAP_V4,
|
37
|
-
};
|
38
5
|
// ─── DTOs ────────────────────────────────────────────────────────────────────
|
39
6
|
export const CampaignUniqueDto = t.Object({
|
40
7
|
distributionChain: t.Numeric(),
|
@@ -93,7 +60,7 @@ export const GetCampaignQueryDto = t.Object({
|
|
93
60
|
chainId: t.Optional(t.Numeric({
|
94
61
|
description: "Filter by chain.<br>You can get the list of all supported chains by calling [GET /v4/chains](#tag/chains/GET/v4/chains/)",
|
95
62
|
})),
|
96
|
-
type: t.Optional(t.
|
63
|
+
type: t.Optional(t.String({ description: "Filter by type of campaign" })),
|
97
64
|
subType: t.Optional(t.Number({
|
98
65
|
description: "Silo, Radiant, Morpho, Dolomite, Compound, Ajna and Euler campaigns have a subtype attribute you can filter on",
|
99
66
|
})),
|
@@ -17,7 +17,7 @@ export declare abstract class CampaignRepository {
|
|
17
17
|
gte: number;
|
18
18
|
} | undefined;
|
19
19
|
subType: number | undefined;
|
20
|
-
type:
|
20
|
+
type: string | undefined;
|
21
21
|
creatorAddress: string | undefined;
|
22
22
|
RewardToken: {
|
23
23
|
address: string | undefined;
|
@@ -67,7 +67,7 @@ export declare abstract class CampaignRepository {
|
|
67
67
|
};
|
68
68
|
};
|
69
69
|
static upsert(campaign: CreateCampaignModel): Promise<{
|
70
|
-
type:
|
70
|
+
type: string;
|
71
71
|
id: string;
|
72
72
|
params: Prisma.JsonValue;
|
73
73
|
subType: number | null;
|
@@ -110,7 +110,7 @@ export declare abstract class CampaignRepository {
|
|
110
110
|
static checkIfExist(campaign: CampaignUnique): Promise<boolean>;
|
111
111
|
static checkIfIdExist(id: string): Promise<boolean>;
|
112
112
|
static findUnique(campaign: CampaignUnique): Promise<{
|
113
|
-
type:
|
113
|
+
type: string;
|
114
114
|
id: string;
|
115
115
|
params: Prisma.JsonValue;
|
116
116
|
subType: number | null;
|
@@ -125,7 +125,7 @@ export declare abstract class CampaignRepository {
|
|
125
125
|
creatorAddress: string;
|
126
126
|
} | null>;
|
127
127
|
static findUniqueOrThrow(id: string): Promise<{
|
128
|
-
type:
|
128
|
+
type: string;
|
129
129
|
id: string;
|
130
130
|
params: Prisma.JsonValue;
|
131
131
|
subType: number | null;
|
@@ -184,7 +184,7 @@ export declare abstract class CampaignRepository {
|
|
184
184
|
price: number | null;
|
185
185
|
};
|
186
186
|
} & {
|
187
|
-
type:
|
187
|
+
type: string;
|
188
188
|
id: string;
|
189
189
|
params: Prisma.JsonValue;
|
190
190
|
subType: number | null;
|
@@ -205,7 +205,7 @@ export declare abstract class CampaignRepository {
|
|
205
205
|
}[]>;
|
206
206
|
static findChains(): Promise<Record<string, ChainId>>;
|
207
207
|
static updateOpportunity(id: string, data: extendedUpdateCampaignModel): Promise<{
|
208
|
-
type:
|
208
|
+
type: string;
|
209
209
|
id: string;
|
210
210
|
params: Prisma.JsonValue;
|
211
211
|
subType: number | null;
|
@@ -220,7 +220,7 @@ export declare abstract class CampaignRepository {
|
|
220
220
|
creatorAddress: string;
|
221
221
|
}>;
|
222
222
|
static updateMetaData(id: string, params: string): Promise<{
|
223
|
-
type:
|
223
|
+
type: string;
|
224
224
|
id: string;
|
225
225
|
params: Prisma.JsonValue;
|
226
226
|
subType: number | null;
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import {
|
1
|
+
import type { CampaignUnique, CampaignWithParams, CreateCampaignModel, GetCampaignQueryModel, UpdateCampaignModel, UpdateMetaDataCampaignModel } from "./";
|
2
2
|
import { CampaignRepository } from "./campaign.repository";
|
3
|
-
import type
|
4
|
-
import { type CampaignParameters, type Campaign as CampaignTypeV3, type ChainId } from "@sdk";
|
3
|
+
import { Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
|
5
4
|
export declare abstract class CampaignService {
|
6
5
|
static hashId(campaign: CampaignUnique): string;
|
7
6
|
static splitIdOrThrow(chainAndCampaignId: `${number}-${string}` | string): CampaignUnique;
|
8
7
|
static create(campaign: Omit<CreateCampaignModel, "id">): Promise<{
|
9
|
-
type:
|
8
|
+
type: string;
|
10
9
|
id: string;
|
11
10
|
params: import("database/api/.generated/runtime/library").JsonValue;
|
12
11
|
subType: number | null;
|
@@ -21,7 +20,7 @@ export declare abstract class CampaignService {
|
|
21
20
|
creatorAddress: string;
|
22
21
|
} | undefined>;
|
23
22
|
static updateMetaData(campaign: Omit<UpdateMetaDataCampaignModel, "id">): Promise<{
|
24
|
-
type:
|
23
|
+
type: string;
|
25
24
|
id: string;
|
26
25
|
params: import("database/api/.generated/runtime/library").JsonValue;
|
27
26
|
subType: number | null;
|
@@ -78,12 +77,13 @@ export declare abstract class CampaignService {
|
|
78
77
|
computedUntil: bigint;
|
79
78
|
processingStarted: bigint;
|
80
79
|
};
|
80
|
+
creatorAddress: string;
|
81
81
|
Creator: {
|
82
82
|
tags: string[];
|
83
83
|
address: string;
|
84
84
|
creatorId: string | null;
|
85
85
|
};
|
86
|
-
type:
|
86
|
+
type: string;
|
87
87
|
id: string;
|
88
88
|
subType: number | null;
|
89
89
|
startTimestamp: bigint;
|
@@ -94,7 +94,6 @@ export declare abstract class CampaignService {
|
|
94
94
|
rewardTokenId: string;
|
95
95
|
amount: string;
|
96
96
|
opportunityId: string;
|
97
|
-
creatorAddress: string;
|
98
97
|
}[]>;
|
99
98
|
/**
|
100
99
|
* Counts the number of campaigns that complies to query
|
@@ -107,7 +106,7 @@ export declare abstract class CampaignService {
|
|
107
106
|
static checkIfExist(campaign: CampaignUnique): Promise<boolean>;
|
108
107
|
static checkIfIdExist(id: string): Promise<boolean>;
|
109
108
|
static findUnique(campaign: CampaignUnique): Promise<{
|
110
|
-
type:
|
109
|
+
type: string;
|
111
110
|
id: string;
|
112
111
|
params: import("database/api/.generated/runtime/library").JsonValue;
|
113
112
|
subType: number | null;
|
@@ -122,7 +121,7 @@ export declare abstract class CampaignService {
|
|
122
121
|
creatorAddress: string;
|
123
122
|
} | null>;
|
124
123
|
static findUniqueOrThrow(campaign: CampaignUnique | string): Promise<{
|
125
|
-
type:
|
124
|
+
type: string;
|
126
125
|
id: string;
|
127
126
|
params: import("database/api/.generated/runtime/library").JsonValue;
|
128
127
|
subType: number | null;
|
@@ -161,9 +160,9 @@ export declare abstract class CampaignService {
|
|
161
160
|
/**
|
162
161
|
* Returns the campaign data
|
163
162
|
* @param type index of Campaign enum from sdk
|
164
|
-
* @returns
|
163
|
+
* @returns a string
|
165
164
|
*/
|
166
|
-
static getTypeFromV3(type:
|
165
|
+
static getTypeFromV3(type: CampaignEnum): string;
|
167
166
|
/**
|
168
167
|
* Split a campaigns array into three array for each status
|
169
168
|
* @param campaigns
|
@@ -224,12 +223,13 @@ export declare abstract class CampaignService {
|
|
224
223
|
computedUntil: bigint;
|
225
224
|
processingStarted: bigint;
|
226
225
|
};
|
226
|
+
creatorAddress: string;
|
227
227
|
Creator: {
|
228
228
|
tags: string[];
|
229
229
|
address: string;
|
230
230
|
creatorId: string | null;
|
231
231
|
};
|
232
|
-
type:
|
232
|
+
type: string;
|
233
233
|
id: string;
|
234
234
|
subType: number | null;
|
235
235
|
startTimestamp: bigint;
|
@@ -240,9 +240,8 @@ export declare abstract class CampaignService {
|
|
240
240
|
rewardTokenId: string;
|
241
241
|
amount: string;
|
242
242
|
opportunityId: string;
|
243
|
-
creatorAddress: string;
|
244
243
|
};
|
245
|
-
static formatAsCampaignParameters<C extends
|
244
|
+
static formatAsCampaignParameters<C extends CampaignEnum>(campaign: CampaignWithParams["model"]): CampaignParameters<C>;
|
246
245
|
/**
|
247
246
|
* Fetches the campaign dynamic data for a v3 campaign onchain
|
248
247
|
* @param chainId
|
@@ -250,7 +249,7 @@ export declare abstract class CampaignService {
|
|
250
249
|
* @param campaigns of v3 type
|
251
250
|
* @returns
|
252
251
|
*/
|
253
|
-
static fetchDynamicData
|
252
|
+
static fetchDynamicData(chainId: number, campaignType: string, campaigns: CampaignParameters<any>[]): Promise<any>;
|
254
253
|
/**
|
255
254
|
* Shortcut to get daily amount from total
|
256
255
|
* @param start timestamp
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import { HttpError } from "../../../errors";
|
2
2
|
import { campaignsDynamicData } from "../../../libs/campaigns/campaignsDynamicData";
|
3
|
-
import { campaignTypeToEnumMap, } from "./";
|
4
3
|
import { CampaignRepository } from "./campaign.repository";
|
5
4
|
import { OpportunityService } from "../opportunity";
|
6
5
|
import { InvalidParameter } from "../../../utils/error";
|
7
6
|
import { executeSimple } from "../../../utils/execute";
|
8
7
|
import { log } from "../../../utils/logger";
|
9
|
-
import { NETWORK_LABELS, } from "@sdk";
|
8
|
+
import { Campaign as CampaignEnum, NETWORK_LABELS, } from "@sdk";
|
10
9
|
import { utils } from "ethers";
|
11
10
|
import moment from "moment";
|
12
11
|
import { StatusService } from "../status";
|
@@ -63,7 +62,7 @@ export class CampaignService {
|
|
63
62
|
creator: existingCampaign.creatorAddress,
|
64
63
|
rewardTokenAddress: token.address,
|
65
64
|
params: JSON.stringify(existingCampaign.params),
|
66
|
-
type:
|
65
|
+
type: CampaignEnum[existingCampaign.type],
|
67
66
|
subType: existingCampaign.subType ?? undefined,
|
68
67
|
startTimestamp: existingCampaign.startTimestamp.toString(),
|
69
68
|
endTimestamp: existingCampaign.endTimestamp.toString(),
|
@@ -211,10 +210,10 @@ export class CampaignService {
|
|
211
210
|
/**
|
212
211
|
* Returns the campaign data
|
213
212
|
* @param type index of Campaign enum from sdk
|
214
|
-
* @returns
|
213
|
+
* @returns a string
|
215
214
|
*/
|
216
215
|
static getTypeFromV3(type) {
|
217
|
-
return
|
216
|
+
return CampaignEnum[type];
|
218
217
|
}
|
219
218
|
/**
|
220
219
|
* Split a campaigns array into three array for each status
|
@@ -253,6 +252,7 @@ export class CampaignService {
|
|
253
252
|
distributionChain: DistributionChain === null ? undefined : DistributionChain,
|
254
253
|
// Todo: need to be change to single 1 to 1 with campaign
|
255
254
|
campaignStatus: CampaignStatus?.[0],
|
255
|
+
creatorAddress: c.Creator.address,
|
256
256
|
};
|
257
257
|
}
|
258
258
|
static formatAsCampaignParameters(campaign) {
|
@@ -273,7 +273,7 @@ export class CampaignService {
|
|
273
273
|
* @returns
|
274
274
|
*/
|
275
275
|
static async fetchDynamicData(chainId, campaignType, campaigns) {
|
276
|
-
const calls = campaignsDynamicData(chainId, campaigns,
|
276
|
+
const calls = campaignsDynamicData(chainId, campaigns, CampaignEnum[campaignType]);
|
277
277
|
return await executeSimple(chainId, calls);
|
278
278
|
}
|
279
279
|
/**
|
@@ -73,7 +73,7 @@ export declare abstract class ChainRepository {
|
|
73
73
|
* @param campaigns of v3 type
|
74
74
|
* @returns
|
75
75
|
*/
|
76
|
-
static fetchDynamicDataV3<
|
76
|
+
static fetchDynamicDataV3<C extends Campaign>(chainId: number, campaignType: C, campaigns: CampaignParameters<C>[]): Promise<any>;
|
77
77
|
static update(id: number, data: UpdateChainModel): Promise<{
|
78
78
|
name: string;
|
79
79
|
id: number;
|
@@ -62,7 +62,7 @@ export declare const DynamicDataController: Elysia<"/dynamic-data", false, {
|
|
62
62
|
rewardTokenAddress?: string | undefined;
|
63
63
|
distributionChain?: {} | undefined;
|
64
64
|
opportunityIdentifier?: string | undefined;
|
65
|
-
type:
|
65
|
+
type: string;
|
66
66
|
params: {};
|
67
67
|
computeChainId: number;
|
68
68
|
};
|
@@ -84,7 +84,7 @@ export declare const DynamicDataController: Elysia<"/dynamic-data", false, {
|
|
84
84
|
body: unknown;
|
85
85
|
params: {};
|
86
86
|
query: {
|
87
|
-
type?:
|
87
|
+
type?: string | undefined;
|
88
88
|
items?: number | undefined;
|
89
89
|
subType?: number | undefined;
|
90
90
|
page?: number | undefined;
|