@merkl/api 0.10.316 → 0.10.318
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/src/eden/index.d.ts +429 -20
- package/dist/src/index.d.ts +157 -6
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +74 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +10 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.model.js +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +6 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +20 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +6 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.js +6 -0
- package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +83 -6
- package/dist/src/modules/v4/programPayload/programPayload.controller.js +11 -1
- package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +108 -0
- package/dist/src/modules/v4/programPayload/programPayload.model.js +50 -15
- package/dist/src/modules/v4/programPayload/programPayload.service.d.ts +12 -5
- package/dist/src/modules/v4/programPayload/programPayload.service.js +65 -40
- package/dist/src/modules/v4/router.d.ts +157 -6
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
@@ -678,6 +678,80 @@ declare const app: Elysia<"", false, {
|
|
678
678
|
};
|
679
679
|
};
|
680
680
|
};
|
681
|
+
} & {
|
682
|
+
opportunities: {
|
683
|
+
aggregate: {
|
684
|
+
max: {
|
685
|
+
":field": {
|
686
|
+
get: {
|
687
|
+
body: unknown;
|
688
|
+
params: {
|
689
|
+
field: never;
|
690
|
+
};
|
691
|
+
query: {
|
692
|
+
sort?: string | undefined;
|
693
|
+
name?: string | undefined;
|
694
|
+
tokens?: string | undefined;
|
695
|
+
status?: string | undefined;
|
696
|
+
items?: number | undefined;
|
697
|
+
tags?: string | undefined;
|
698
|
+
page?: number | undefined;
|
699
|
+
chainId?: string | undefined;
|
700
|
+
action?: string | undefined;
|
701
|
+
creatorAddress?: string | undefined;
|
702
|
+
mainProtocolId?: string | undefined;
|
703
|
+
order?: string | undefined;
|
704
|
+
test?: boolean | undefined;
|
705
|
+
minimumTvl?: number | undefined;
|
706
|
+
};
|
707
|
+
headers: unknown;
|
708
|
+
response: {
|
709
|
+
200: {
|
710
|
+
max: string;
|
711
|
+
};
|
712
|
+
};
|
713
|
+
};
|
714
|
+
};
|
715
|
+
};
|
716
|
+
};
|
717
|
+
};
|
718
|
+
} & {
|
719
|
+
opportunities: {
|
720
|
+
aggregate: {
|
721
|
+
min: {
|
722
|
+
":field": {
|
723
|
+
get: {
|
724
|
+
body: unknown;
|
725
|
+
params: {
|
726
|
+
field: never;
|
727
|
+
};
|
728
|
+
query: {
|
729
|
+
sort?: string | undefined;
|
730
|
+
name?: string | undefined;
|
731
|
+
tokens?: string | undefined;
|
732
|
+
status?: string | undefined;
|
733
|
+
items?: number | undefined;
|
734
|
+
tags?: string | undefined;
|
735
|
+
page?: number | undefined;
|
736
|
+
chainId?: string | undefined;
|
737
|
+
action?: string | undefined;
|
738
|
+
creatorAddress?: string | undefined;
|
739
|
+
mainProtocolId?: string | undefined;
|
740
|
+
order?: string | undefined;
|
741
|
+
test?: boolean | undefined;
|
742
|
+
minimumTvl?: number | undefined;
|
743
|
+
};
|
744
|
+
headers: unknown;
|
745
|
+
response: {
|
746
|
+
200: {
|
747
|
+
min: string;
|
748
|
+
};
|
749
|
+
};
|
750
|
+
};
|
751
|
+
};
|
752
|
+
};
|
753
|
+
};
|
754
|
+
};
|
681
755
|
} & {
|
682
756
|
opportunities: {
|
683
757
|
":id": {
|
@@ -2807,8 +2881,16 @@ declare const app: Elysia<"", false, {
|
|
2807
2881
|
};
|
2808
2882
|
headers: unknown;
|
2809
2883
|
response: {
|
2810
|
-
|
2811
|
-
|
2884
|
+
200: {
|
2885
|
+
version: string;
|
2886
|
+
chainId: string;
|
2887
|
+
createdAt: number;
|
2888
|
+
meta: {
|
2889
|
+
name: string;
|
2890
|
+
txBuilderVersion: string;
|
2891
|
+
};
|
2892
|
+
transactions: import("./modules/v4/programPayload").transaction[];
|
2893
|
+
};
|
2812
2894
|
};
|
2813
2895
|
};
|
2814
2896
|
};
|
@@ -2879,8 +2961,16 @@ declare const app: Elysia<"", false, {
|
|
2879
2961
|
};
|
2880
2962
|
headers: unknown;
|
2881
2963
|
response: {
|
2882
|
-
|
2883
|
-
|
2964
|
+
200: {
|
2965
|
+
version: string;
|
2966
|
+
chainId: string;
|
2967
|
+
createdAt: number;
|
2968
|
+
meta: {
|
2969
|
+
name: string;
|
2970
|
+
txBuilderVersion: string;
|
2971
|
+
};
|
2972
|
+
transactions: import("./modules/v4/programPayload").transaction[];
|
2973
|
+
} | null;
|
2884
2974
|
};
|
2885
2975
|
};
|
2886
2976
|
};
|
@@ -2905,8 +2995,69 @@ declare const app: Elysia<"", false, {
|
|
2905
2995
|
};
|
2906
2996
|
headers: unknown;
|
2907
2997
|
response: {
|
2908
|
-
|
2909
|
-
|
2998
|
+
200: {
|
2999
|
+
version: string;
|
3000
|
+
chainId: string;
|
3001
|
+
createdAt: number;
|
3002
|
+
meta: {
|
3003
|
+
name: string;
|
3004
|
+
txBuilderVersion: string;
|
3005
|
+
};
|
3006
|
+
transactions: import("./modules/v4/programPayload").transaction[];
|
3007
|
+
} | null;
|
3008
|
+
};
|
3009
|
+
};
|
3010
|
+
};
|
3011
|
+
};
|
3012
|
+
};
|
3013
|
+
} & {
|
3014
|
+
"program-payload": {
|
3015
|
+
payload: {
|
3016
|
+
"from-config": {
|
3017
|
+
post: {
|
3018
|
+
body: {
|
3019
|
+
url?: string | undefined;
|
3020
|
+
endTimestamp?: number | undefined;
|
3021
|
+
poolAddress?: string | undefined;
|
3022
|
+
marketId?: string | undefined;
|
3023
|
+
strategy?: string | undefined;
|
3024
|
+
poolId?: string | undefined;
|
3025
|
+
contract?: string | undefined;
|
3026
|
+
forwarders?: {}[] | undefined;
|
3027
|
+
targetToken?: string | undefined;
|
3028
|
+
isOutOfRangeIncentivized?: boolean | undefined;
|
3029
|
+
weightFees?: number | undefined;
|
3030
|
+
weightToken0?: number | undefined;
|
3031
|
+
weightToken1?: number | undefined;
|
3032
|
+
usesBlockNumber?: boolean | undefined;
|
3033
|
+
snapshotTimestamp?: number | undefined;
|
3034
|
+
snapshotBlockNumber?: number | undefined;
|
3035
|
+
jsonUrl?: string | undefined;
|
3036
|
+
subCampaignType?: number | undefined;
|
3037
|
+
repository?: string | undefined;
|
3038
|
+
capInUSD?: string | undefined;
|
3039
|
+
compFork?: number | undefined;
|
3040
|
+
evkAddress?: string | undefined;
|
3041
|
+
collateralAddress?: string | undefined;
|
3042
|
+
hooks: {}[];
|
3043
|
+
creator: string;
|
3044
|
+
startTimestamp: number;
|
3045
|
+
computeChainId: number;
|
3046
|
+
distributionChainId: number;
|
3047
|
+
amount: string;
|
3048
|
+
blacklist: string[];
|
3049
|
+
rewardToken: string;
|
3050
|
+
campaignType: number;
|
3051
|
+
whitelist: string[];
|
3052
|
+
};
|
3053
|
+
params: {};
|
3054
|
+
query: unknown;
|
3055
|
+
headers: unknown;
|
3056
|
+
response: {
|
3057
|
+
200: {
|
3058
|
+
safePayload: import("./modules/v4/programPayload").safePayload;
|
3059
|
+
nonEncodedConfig: any;
|
3060
|
+
};
|
2910
3061
|
};
|
2911
3062
|
};
|
2912
3063
|
};
|
@@ -547,6 +547,80 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
547
547
|
};
|
548
548
|
};
|
549
549
|
};
|
550
|
+
} & {
|
551
|
+
opportunities: {
|
552
|
+
aggregate: {
|
553
|
+
max: {
|
554
|
+
":field": {
|
555
|
+
get: {
|
556
|
+
body: unknown;
|
557
|
+
params: {
|
558
|
+
field: never;
|
559
|
+
};
|
560
|
+
query: {
|
561
|
+
sort?: string | undefined;
|
562
|
+
name?: string | undefined;
|
563
|
+
tokens?: string | undefined;
|
564
|
+
status?: string | undefined;
|
565
|
+
items?: number | undefined;
|
566
|
+
tags?: string | undefined;
|
567
|
+
page?: number | undefined;
|
568
|
+
chainId?: string | undefined;
|
569
|
+
action?: string | undefined;
|
570
|
+
creatorAddress?: string | undefined;
|
571
|
+
mainProtocolId?: string | undefined;
|
572
|
+
order?: string | undefined;
|
573
|
+
test?: boolean | undefined;
|
574
|
+
minimumTvl?: number | undefined;
|
575
|
+
};
|
576
|
+
headers: unknown;
|
577
|
+
response: {
|
578
|
+
200: {
|
579
|
+
max: string;
|
580
|
+
};
|
581
|
+
};
|
582
|
+
};
|
583
|
+
};
|
584
|
+
};
|
585
|
+
};
|
586
|
+
};
|
587
|
+
} & {
|
588
|
+
opportunities: {
|
589
|
+
aggregate: {
|
590
|
+
min: {
|
591
|
+
":field": {
|
592
|
+
get: {
|
593
|
+
body: unknown;
|
594
|
+
params: {
|
595
|
+
field: never;
|
596
|
+
};
|
597
|
+
query: {
|
598
|
+
sort?: string | undefined;
|
599
|
+
name?: string | undefined;
|
600
|
+
tokens?: string | undefined;
|
601
|
+
status?: string | undefined;
|
602
|
+
items?: number | undefined;
|
603
|
+
tags?: string | undefined;
|
604
|
+
page?: number | undefined;
|
605
|
+
chainId?: string | undefined;
|
606
|
+
action?: string | undefined;
|
607
|
+
creatorAddress?: string | undefined;
|
608
|
+
mainProtocolId?: string | undefined;
|
609
|
+
order?: string | undefined;
|
610
|
+
test?: boolean | undefined;
|
611
|
+
minimumTvl?: number | undefined;
|
612
|
+
};
|
613
|
+
headers: unknown;
|
614
|
+
response: {
|
615
|
+
200: {
|
616
|
+
min: string;
|
617
|
+
};
|
618
|
+
};
|
619
|
+
};
|
620
|
+
};
|
621
|
+
};
|
622
|
+
};
|
623
|
+
};
|
550
624
|
} & {
|
551
625
|
opportunities: {
|
552
626
|
":id": {
|
@@ -131,6 +131,16 @@ export const OpportunityController = new Elysia({
|
|
131
131
|
.get("/aggregate/:field", async ({ query, params }) => await OpportunityService.aggregate(query, params.field), {
|
132
132
|
params: OpportunityAggregateFieldDto,
|
133
133
|
query: GetOpportunitiesQueryDto,
|
134
|
+
})
|
135
|
+
// ─── Get Aggregate Fields ────────────────────────────────────────────
|
136
|
+
.get("/aggregate/max/:field", async ({ query, params }) => await OpportunityService.aggregateMax(query, params.field), {
|
137
|
+
params: OpportunityAggregateFieldDto,
|
138
|
+
query: GetOpportunitiesQueryDto,
|
139
|
+
})
|
140
|
+
// ─── Get Aggregate Fields ────────────────────────────────────────────
|
141
|
+
.get("/aggregate/min/:field", async ({ query, params }) => await OpportunityService.aggregateMin(query, params.field), {
|
142
|
+
params: OpportunityAggregateFieldDto,
|
143
|
+
query: GetOpportunitiesQueryDto,
|
134
144
|
})
|
135
145
|
// ─── Update An Opportunity ───────────────────────────────────────────
|
136
146
|
.patch("/:id", async ({ params, body }) => await OpportunityService.update(params.id, body), {
|
@@ -344,7 +344,7 @@ export declare const CreateOpportunityDto: import("@sinclair/typebox").TObject<{
|
|
344
344
|
tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
345
345
|
}>;
|
346
346
|
export declare const OpportunityAggregateFieldDto: import("@sinclair/typebox").TObject<{
|
347
|
-
field: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"dailyRewards">[]>;
|
347
|
+
field: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"tvl" | "apr" | "dailyRewards">[]>;
|
348
348
|
}>;
|
349
349
|
export declare const OpportunityIdDto: import("@sinclair/typebox").TObject<{
|
350
350
|
id: import("@sinclair/typebox").TString;
|
@@ -87,7 +87,7 @@ export const CreateOpportunityDto = t.Object({
|
|
87
87
|
tags: t.Optional(t.Array(t.String())),
|
88
88
|
});
|
89
89
|
export const OpportunityAggregateFieldDto = t.Object({
|
90
|
-
field: t.Union(["dailyRewards"].map(v => t.Literal(v))),
|
90
|
+
field: t.Union(["dailyRewards", "tvl", "apr"].map(v => t.Literal(v))),
|
91
91
|
});
|
92
92
|
export const OpportunityIdDto = t.Object({ id: t.String() });
|
93
93
|
export const UpdateOpportunityDto = t.Object({
|
@@ -902,6 +902,12 @@ export declare abstract class OpportunityRepository {
|
|
902
902
|
static aggregateSum(field: keyof Prisma.OpportunitySumAggregateInputType, query: GetOpportunitiesQueryModel): Promise<{
|
903
903
|
sum: string;
|
904
904
|
}>;
|
905
|
+
static aggregateMin(field: keyof Prisma.OpportunityMinAggregateInputType, query: GetOpportunitiesQueryModel): Promise<{
|
906
|
+
min: string;
|
907
|
+
}>;
|
908
|
+
static aggregateMax(field: keyof Prisma.OpportunityMaxAggregateInputType, query: GetOpportunitiesQueryModel): Promise<{
|
909
|
+
max: string;
|
910
|
+
}>;
|
905
911
|
static update(id: string, data: UpdateOpportunityModel): Promise<{
|
906
912
|
name: string;
|
907
913
|
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
@@ -382,6 +382,26 @@ export class OpportunityRepository {
|
|
382
382
|
});
|
383
383
|
return { sum: result._sum[field] ?? null };
|
384
384
|
}
|
385
|
+
static async aggregateMin(field, query) {
|
386
|
+
const args = OpportunityRepository.#transformQueryToPrismaFilters(query);
|
387
|
+
const result = await apiDbClient.opportunity.aggregate({
|
388
|
+
_min: {
|
389
|
+
[field]: true,
|
390
|
+
},
|
391
|
+
...args,
|
392
|
+
});
|
393
|
+
return { min: result._min[field] ?? null };
|
394
|
+
}
|
395
|
+
static async aggregateMax(field, query) {
|
396
|
+
const args = OpportunityRepository.#transformQueryToPrismaFilters(query);
|
397
|
+
const result = await apiDbClient.opportunity.aggregate({
|
398
|
+
_max: {
|
399
|
+
[field]: true,
|
400
|
+
},
|
401
|
+
...args,
|
402
|
+
});
|
403
|
+
return { max: result._max[field] ?? null };
|
404
|
+
}
|
385
405
|
static async update(id, data) {
|
386
406
|
return await apiDbClient.opportunity.update({ where: { id }, data });
|
387
407
|
}
|
@@ -451,6 +451,12 @@ export declare abstract class OpportunityService {
|
|
451
451
|
static aggregate(query: GetOpportunitiesQueryModel, field: keyof Prisma.OpportunitySumAggregateInputType): Promise<{
|
452
452
|
sum: string;
|
453
453
|
}>;
|
454
|
+
static aggregateMin(query: GetOpportunitiesQueryModel, field: keyof Prisma.OpportunityMinAggregateInputType): Promise<{
|
455
|
+
min: string;
|
456
|
+
}>;
|
457
|
+
static aggregateMax(query: GetOpportunitiesQueryModel, field: keyof Prisma.OpportunityMaxAggregateInputType): Promise<{
|
458
|
+
max: string;
|
459
|
+
}>;
|
454
460
|
static update(id: string, data: UpdateOpportunityModel): Promise<{
|
455
461
|
name: string;
|
456
462
|
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
@@ -266,6 +266,12 @@ export class OpportunityService {
|
|
266
266
|
static aggregate(query, field) {
|
267
267
|
return OpportunityRepository.aggregateSum(field, query);
|
268
268
|
}
|
269
|
+
static aggregateMin(query, field) {
|
270
|
+
return OpportunityRepository.aggregateMin(field, query);
|
271
|
+
}
|
272
|
+
static aggregateMax(query, field) {
|
273
|
+
return OpportunityRepository.aggregateMax(field, query);
|
274
|
+
}
|
269
275
|
static async update(id, data) {
|
270
276
|
return await OpportunityRepository.update(id, data);
|
271
277
|
}
|
@@ -29,8 +29,16 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
29
29
|
};
|
30
30
|
headers: unknown;
|
31
31
|
response: {
|
32
|
-
|
33
|
-
|
32
|
+
200: {
|
33
|
+
version: string;
|
34
|
+
chainId: string;
|
35
|
+
createdAt: number;
|
36
|
+
meta: {
|
37
|
+
name: string;
|
38
|
+
txBuilderVersion: string;
|
39
|
+
};
|
40
|
+
transactions: import("./programPayload.model").transaction[];
|
41
|
+
};
|
34
42
|
};
|
35
43
|
};
|
36
44
|
};
|
@@ -101,8 +109,16 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
101
109
|
};
|
102
110
|
headers: unknown;
|
103
111
|
response: {
|
104
|
-
|
105
|
-
|
112
|
+
200: {
|
113
|
+
version: string;
|
114
|
+
chainId: string;
|
115
|
+
createdAt: number;
|
116
|
+
meta: {
|
117
|
+
name: string;
|
118
|
+
txBuilderVersion: string;
|
119
|
+
};
|
120
|
+
transactions: import("./programPayload.model").transaction[];
|
121
|
+
} | null;
|
106
122
|
};
|
107
123
|
};
|
108
124
|
};
|
@@ -127,8 +143,69 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
|
|
127
143
|
};
|
128
144
|
headers: unknown;
|
129
145
|
response: {
|
130
|
-
|
131
|
-
|
146
|
+
200: {
|
147
|
+
version: string;
|
148
|
+
chainId: string;
|
149
|
+
createdAt: number;
|
150
|
+
meta: {
|
151
|
+
name: string;
|
152
|
+
txBuilderVersion: string;
|
153
|
+
};
|
154
|
+
transactions: import("./programPayload.model").transaction[];
|
155
|
+
} | null;
|
156
|
+
};
|
157
|
+
};
|
158
|
+
};
|
159
|
+
};
|
160
|
+
};
|
161
|
+
} & {
|
162
|
+
"program-payload": {
|
163
|
+
payload: {
|
164
|
+
"from-config": {
|
165
|
+
post: {
|
166
|
+
body: {
|
167
|
+
url?: string | undefined;
|
168
|
+
endTimestamp?: number | undefined;
|
169
|
+
poolAddress?: string | undefined;
|
170
|
+
marketId?: string | undefined;
|
171
|
+
strategy?: string | undefined;
|
172
|
+
poolId?: string | undefined;
|
173
|
+
contract?: string | undefined;
|
174
|
+
forwarders?: {}[] | undefined;
|
175
|
+
targetToken?: string | undefined;
|
176
|
+
isOutOfRangeIncentivized?: boolean | undefined;
|
177
|
+
weightFees?: number | undefined;
|
178
|
+
weightToken0?: number | undefined;
|
179
|
+
weightToken1?: number | undefined;
|
180
|
+
usesBlockNumber?: boolean | undefined;
|
181
|
+
snapshotTimestamp?: number | undefined;
|
182
|
+
snapshotBlockNumber?: number | undefined;
|
183
|
+
jsonUrl?: string | undefined;
|
184
|
+
subCampaignType?: number | undefined;
|
185
|
+
repository?: string | undefined;
|
186
|
+
capInUSD?: string | undefined;
|
187
|
+
compFork?: number | undefined;
|
188
|
+
evkAddress?: string | undefined;
|
189
|
+
collateralAddress?: string | undefined;
|
190
|
+
hooks: {}[];
|
191
|
+
creator: string;
|
192
|
+
startTimestamp: number;
|
193
|
+
computeChainId: number;
|
194
|
+
distributionChainId: number;
|
195
|
+
amount: string;
|
196
|
+
blacklist: string[];
|
197
|
+
rewardToken: string;
|
198
|
+
campaignType: number;
|
199
|
+
whitelist: string[];
|
200
|
+
};
|
201
|
+
params: {};
|
202
|
+
query: unknown;
|
203
|
+
headers: unknown;
|
204
|
+
response: {
|
205
|
+
200: {
|
206
|
+
safePayload: import("./programPayload.model").safePayload;
|
207
|
+
nonEncodedConfig: any;
|
208
|
+
};
|
132
209
|
};
|
133
210
|
};
|
134
211
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
2
2
|
import Elysia from "elysia";
|
3
3
|
import { throwOnUnsupportedChainId } from "src/utils/throw";
|
4
|
-
import { CampaignAmountsInputDto, CampaignPayloadInputDto, ProgramPayloadInputDto } from "./programPayload.model";
|
4
|
+
import { CampaignAmountsInputDto, CampaignPayloadInputDto, ProgramPayloadInputDto, SinglePayloadInputDto, } from "./programPayload.model";
|
5
5
|
import { ProgramPayloadService } from "./programPayload.service";
|
6
6
|
// ─── ProgramPaylod Controller ───────────────────────────────────────────────────────
|
7
7
|
export const ProgramPayloadController = new Elysia({ prefix: "/program-payload", detail: { tags: ["ProgramPayload"] } })
|
@@ -25,6 +25,7 @@ export const ProgramPayloadController = new Elysia({ prefix: "/program-payload",
|
|
25
25
|
// BackOfficeGuard({ headers });
|
26
26
|
throwOnUnsupportedChainId(query.distributionChainId);
|
27
27
|
},
|
28
|
+
detail: { description: "Generate the configuration for a specific hardcoded campaign from a program" },
|
28
29
|
})
|
29
30
|
.get("/campaignData", async ({ query }) => {
|
30
31
|
return ProgramPayloadService.buildCampaignData(query);
|
@@ -35,6 +36,7 @@ export const ProgramPayloadController = new Elysia({ prefix: "/program-payload",
|
|
35
36
|
// BackOfficeGuard({ headers });
|
36
37
|
throwOnUnsupportedChainId(query.distributionChainId);
|
37
38
|
},
|
39
|
+
detail: { description: "Generate the campaign data for a specific hardcoded campaign from a program" },
|
38
40
|
})
|
39
41
|
.get("/program", async ({ query }) => {
|
40
42
|
return ProgramPayloadService.buildProgramPayload(query);
|
@@ -45,6 +47,7 @@ export const ProgramPayloadController = new Elysia({ prefix: "/program-payload",
|
|
45
47
|
// BackOfficeGuard({ headers });
|
46
48
|
throwOnUnsupportedChainId(query.distributionChainId);
|
47
49
|
},
|
50
|
+
detail: { description: "Generate the complete payload for a program" },
|
48
51
|
})
|
49
52
|
.post("/program/withAmounts", async ({ query, body }) => {
|
50
53
|
return ProgramPayloadService.buildProgramPayloadWithAmounts(query, body);
|
@@ -54,4 +57,11 @@ export const ProgramPayloadController = new Elysia({ prefix: "/program-payload",
|
|
54
57
|
beforeHandle: ({ query }) => {
|
55
58
|
throwOnUnsupportedChainId(query.distributionChainId);
|
56
59
|
},
|
60
|
+
detail: { description: "Generate the payload with the campaigns and amounts provided" },
|
61
|
+
})
|
62
|
+
.post("/payload/from-config", async ({ body }) => {
|
63
|
+
return ProgramPayloadService.buildPayloadFromConfig(body);
|
64
|
+
}, {
|
65
|
+
body: SinglePayloadInputDto,
|
66
|
+
detail: { description: "BETA FEATURE : Generate the payload from a config file." },
|
57
67
|
});
|
@@ -9,6 +9,41 @@ export declare const CampaignPayloadInputDto: import("@sinclair/typebox").TObjec
|
|
9
9
|
endTimestamp: import("@sinclair/typebox").TNumber;
|
10
10
|
amount: import("@sinclair/typebox").TString;
|
11
11
|
}>;
|
12
|
+
export declare const SinglePayloadInputDto: import("@sinclair/typebox").TObject<{
|
13
|
+
distributionChainId: import("@sinclair/typebox").TNumber;
|
14
|
+
rewardToken: import("@sinclair/typebox").TString;
|
15
|
+
amount: import("@sinclair/typebox").TString;
|
16
|
+
startTimestamp: import("@sinclair/typebox").TNumber;
|
17
|
+
computeChainId: import("@sinclair/typebox").TNumber;
|
18
|
+
creator: import("@sinclair/typebox").TString;
|
19
|
+
hooks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>;
|
20
|
+
whitelist: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
21
|
+
blacklist: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
22
|
+
campaignType: import("@sinclair/typebox").TNumber;
|
23
|
+
endTimestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
24
|
+
targetToken: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
25
|
+
url: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
26
|
+
forwarders: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>>;
|
27
|
+
poolAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
28
|
+
isOutOfRangeIncentivized: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
29
|
+
weightFees: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
30
|
+
weightToken0: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
31
|
+
weightToken1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
32
|
+
usesBlockNumber: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
33
|
+
snapshotTimestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
34
|
+
snapshotBlockNumber: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
35
|
+
jsonUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
36
|
+
subCampaignType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
37
|
+
repository: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
38
|
+
capInUSD: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
39
|
+
marketId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
40
|
+
compFork: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
41
|
+
poolId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
42
|
+
evkAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
43
|
+
collateralAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
44
|
+
strategy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
45
|
+
contract: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
46
|
+
}>;
|
12
47
|
export declare const ProgramPayloadInputDto: import("@sinclair/typebox").TObject<{
|
13
48
|
program: import("@sinclair/typebox").TString;
|
14
49
|
creator: import("@sinclair/typebox").TString;
|
@@ -22,6 +57,79 @@ export declare const CampaignAmountsInputDto: import("@sinclair/typebox").TRecor
|
|
22
57
|
export type CampaignPayloadInputModel = typeof CampaignPayloadInputDto.static;
|
23
58
|
export type ProgramPayloadInputModel = typeof ProgramPayloadInputDto.static;
|
24
59
|
export type CampaignAmountsInputModel = typeof CampaignAmountsInputDto.static;
|
60
|
+
export type SinglePayloadInputDtoModel = typeof SinglePayloadInputDto.static;
|
61
|
+
export type approvalTransaction = {
|
62
|
+
to: string;
|
63
|
+
value: string;
|
64
|
+
data: null;
|
65
|
+
contractMethod: {
|
66
|
+
inputs: {
|
67
|
+
name: string;
|
68
|
+
type: string;
|
69
|
+
internalType: string;
|
70
|
+
}[];
|
71
|
+
name: string;
|
72
|
+
payable: boolean;
|
73
|
+
};
|
74
|
+
contractInputsValues: {
|
75
|
+
spender: string;
|
76
|
+
amount: string;
|
77
|
+
};
|
78
|
+
};
|
79
|
+
export type acceptConditionsTransaction = {
|
80
|
+
to: string;
|
81
|
+
value: string;
|
82
|
+
data: null;
|
83
|
+
contractMethod: {
|
84
|
+
inputs: any[];
|
85
|
+
name: string;
|
86
|
+
payable: boolean;
|
87
|
+
};
|
88
|
+
contractInputsValues: null;
|
89
|
+
};
|
90
|
+
export type createCampaignTransaction = {
|
91
|
+
to: string;
|
92
|
+
value: string;
|
93
|
+
data: null;
|
94
|
+
contractMethod: {
|
95
|
+
inputs: {
|
96
|
+
components: {
|
97
|
+
internalType: string;
|
98
|
+
name: string;
|
99
|
+
type: string;
|
100
|
+
}[];
|
101
|
+
internalType: string;
|
102
|
+
name: string;
|
103
|
+
type: string;
|
104
|
+
}[];
|
105
|
+
name: string;
|
106
|
+
payable: boolean;
|
107
|
+
};
|
108
|
+
contractInputsValues: {
|
109
|
+
newCampaign: string;
|
110
|
+
};
|
111
|
+
};
|
112
|
+
export type transaction = approvalTransaction | acceptConditionsTransaction | createCampaignTransaction;
|
113
|
+
export type safeCompletePayload = {
|
114
|
+
version: string;
|
115
|
+
chainId: string;
|
116
|
+
createdAt: number;
|
117
|
+
meta: {
|
118
|
+
name: string;
|
119
|
+
txBuilderVersion: string;
|
120
|
+
};
|
121
|
+
transactions: [approvalTransaction, acceptConditionsTransaction, createCampaignTransaction];
|
122
|
+
};
|
123
|
+
export type safePayload = {
|
124
|
+
version: string;
|
125
|
+
chainId: string;
|
126
|
+
createdAt: number;
|
127
|
+
meta: {
|
128
|
+
name: string;
|
129
|
+
txBuilderVersion: string;
|
130
|
+
};
|
131
|
+
transactions: transaction[];
|
132
|
+
};
|
25
133
|
export type partialConfigERC20 = {
|
26
134
|
computeChainId?: MerklChainId;
|
27
135
|
hooks?: (HookParameters<HOOK> | string)[];
|