@merkl/api 0.10.351 → 0.10.353

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.
@@ -2248,6 +2248,68 @@ declare const eden: {
2248
2248
  };
2249
2249
  }>>;
2250
2250
  };
2251
+ "from-config": {
2252
+ post: (body: {
2253
+ id?: string | undefined;
2254
+ tags?: string[] | undefined;
2255
+ identifier?: string | undefined;
2256
+ subType?: number | undefined;
2257
+ chain?: {} | undefined;
2258
+ chainId?: number | undefined;
2259
+ startTimestamp?: string | undefined;
2260
+ endTimestamp?: string | undefined;
2261
+ distributionChainId?: number | undefined;
2262
+ campaignId?: string | undefined;
2263
+ rewardTokenId?: string | undefined;
2264
+ amount?: string | undefined;
2265
+ opportunityId?: string | undefined;
2266
+ creatorAddress?: string | undefined;
2267
+ campaignStatus?: {} | undefined;
2268
+ rewardToken?: {} | undefined;
2269
+ rewardTokenAddress?: string | undefined;
2270
+ distributionChain?: {} | undefined;
2271
+ opportunityIdentifier?: string | undefined;
2272
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST";
2273
+ params: {};
2274
+ computeChainId: number;
2275
+ }, options: {
2276
+ headers: {
2277
+ authorization: string;
2278
+ };
2279
+ query?: Record<string, unknown> | undefined;
2280
+ fetch?: RequestInit | undefined;
2281
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2282
+ [x: string]: any;
2283
+ 200: any;
2284
+ }>>;
2285
+ };
2286
+ "from-existing": {
2287
+ get: (options: {
2288
+ headers: {
2289
+ authorization: string;
2290
+ };
2291
+ query: {
2292
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST" | undefined;
2293
+ items?: number | undefined;
2294
+ subType?: number | undefined;
2295
+ page?: number | undefined;
2296
+ chainId?: number | undefined;
2297
+ startTimestamp?: string | undefined;
2298
+ endTimestamp?: string | undefined;
2299
+ tokenAddress?: string | undefined;
2300
+ mainParameter?: string | undefined;
2301
+ campaignId?: string | undefined;
2302
+ opportunityId?: string | undefined;
2303
+ test?: boolean | undefined;
2304
+ creatorTag?: string | undefined;
2305
+ tokenSymbol?: string | undefined;
2306
+ };
2307
+ fetch?: RequestInit | undefined;
2308
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2309
+ [x: string]: any;
2310
+ 200: any;
2311
+ }>>;
2312
+ };
2251
2313
  };
2252
2314
  "campaign-status": ((params: {
2253
2315
  campaignId: string | number;
@@ -2568,12 +2630,23 @@ declare const eden: {
2568
2630
  amount: string;
2569
2631
  rewardToken: string;
2570
2632
  campaignType: number;
2571
- }, options?: {
2633
+ }, options: {
2572
2634
  headers?: Record<string, unknown> | undefined;
2573
- query?: Record<string, unknown> | undefined;
2635
+ query: {
2636
+ debug?: boolean | undefined;
2637
+ };
2574
2638
  fetch?: RequestInit | undefined;
2575
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2639
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2576
2640
  200: {
2641
+ version: string;
2642
+ chainId: string;
2643
+ createdAt: number;
2644
+ meta: {
2645
+ name: string;
2646
+ txBuilderVersion: string;
2647
+ };
2648
+ transactions: import("../modules/v4/programPayload").transaction[];
2649
+ } | {
2577
2650
  safePayload: import("../modules/v4/programPayload").safePayload;
2578
2651
  nonEncodedConfig: any;
2579
2652
  };
@@ -6005,6 +6078,78 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6005
6078
  };
6006
6079
  };
6007
6080
  };
6081
+ } & {
6082
+ "dynamic-data": {
6083
+ "from-config": {
6084
+ post: {
6085
+ body: {
6086
+ id?: string | undefined;
6087
+ tags?: string[] | undefined;
6088
+ identifier?: string | undefined;
6089
+ subType?: number | undefined;
6090
+ chain?: {} | undefined;
6091
+ chainId?: number | undefined;
6092
+ startTimestamp?: string | undefined;
6093
+ endTimestamp?: string | undefined;
6094
+ distributionChainId?: number | undefined;
6095
+ campaignId?: string | undefined;
6096
+ rewardTokenId?: string | undefined;
6097
+ amount?: string | undefined;
6098
+ opportunityId?: string | undefined;
6099
+ creatorAddress?: string | undefined;
6100
+ campaignStatus?: {} | undefined;
6101
+ rewardToken?: {} | undefined;
6102
+ rewardTokenAddress?: string | undefined;
6103
+ distributionChain?: {} | undefined;
6104
+ opportunityIdentifier?: string | undefined;
6105
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST";
6106
+ params: {};
6107
+ computeChainId: number;
6108
+ };
6109
+ params: {};
6110
+ query: unknown;
6111
+ headers: {
6112
+ authorization: string;
6113
+ };
6114
+ response: {
6115
+ [x: string]: any;
6116
+ 200: any;
6117
+ };
6118
+ };
6119
+ };
6120
+ };
6121
+ } & {
6122
+ "dynamic-data": {
6123
+ "from-existing": {
6124
+ get: {
6125
+ body: unknown;
6126
+ params: {};
6127
+ query: {
6128
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST" | undefined;
6129
+ items?: number | undefined;
6130
+ subType?: number | undefined;
6131
+ page?: number | undefined;
6132
+ chainId?: number | undefined;
6133
+ startTimestamp?: string | undefined;
6134
+ endTimestamp?: string | undefined;
6135
+ tokenAddress?: string | undefined;
6136
+ mainParameter?: string | undefined;
6137
+ campaignId?: string | undefined;
6138
+ opportunityId?: string | undefined;
6139
+ test?: boolean | undefined;
6140
+ creatorTag?: string | undefined;
6141
+ tokenSymbol?: string | undefined;
6142
+ };
6143
+ headers: {
6144
+ authorization: string;
6145
+ };
6146
+ response: {
6147
+ [x: string]: any;
6148
+ 200: any;
6149
+ };
6150
+ };
6151
+ };
6152
+ };
6008
6153
  };
6009
6154
  } & {
6010
6155
  v4: {
@@ -6397,10 +6542,21 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6397
6542
  campaignType: number;
6398
6543
  };
6399
6544
  params: {};
6400
- query: unknown;
6545
+ query: {
6546
+ debug?: boolean | undefined;
6547
+ };
6401
6548
  headers: unknown;
6402
6549
  response: {
6403
6550
  200: {
6551
+ version: string;
6552
+ chainId: string;
6553
+ createdAt: number;
6554
+ meta: {
6555
+ name: string;
6556
+ txBuilderVersion: string;
6557
+ };
6558
+ transactions: import("../modules/v4/programPayload").transaction[];
6559
+ } | {
6404
6560
  safePayload: import("../modules/v4/programPayload").safePayload;
6405
6561
  nonEncodedConfig: any;
6406
6562
  };
@@ -9477,6 +9633,68 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
9477
9633
  };
9478
9634
  }>>;
9479
9635
  };
9636
+ "from-config": {
9637
+ post: (body: {
9638
+ id?: string | undefined;
9639
+ tags?: string[] | undefined;
9640
+ identifier?: string | undefined;
9641
+ subType?: number | undefined;
9642
+ chain?: {} | undefined;
9643
+ chainId?: number | undefined;
9644
+ startTimestamp?: string | undefined;
9645
+ endTimestamp?: string | undefined;
9646
+ distributionChainId?: number | undefined;
9647
+ campaignId?: string | undefined;
9648
+ rewardTokenId?: string | undefined;
9649
+ amount?: string | undefined;
9650
+ opportunityId?: string | undefined;
9651
+ creatorAddress?: string | undefined;
9652
+ campaignStatus?: {} | undefined;
9653
+ rewardToken?: {} | undefined;
9654
+ rewardTokenAddress?: string | undefined;
9655
+ distributionChain?: {} | undefined;
9656
+ opportunityIdentifier?: string | undefined;
9657
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST";
9658
+ params: {};
9659
+ computeChainId: number;
9660
+ }, options: {
9661
+ headers: {
9662
+ authorization: string;
9663
+ };
9664
+ query?: Record<string, unknown> | undefined;
9665
+ fetch?: RequestInit | undefined;
9666
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
9667
+ [x: string]: any;
9668
+ 200: any;
9669
+ }>>;
9670
+ };
9671
+ "from-existing": {
9672
+ get: (options: {
9673
+ headers: {
9674
+ authorization: string;
9675
+ };
9676
+ query: {
9677
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST" | undefined;
9678
+ items?: number | undefined;
9679
+ subType?: number | undefined;
9680
+ page?: number | undefined;
9681
+ chainId?: number | undefined;
9682
+ startTimestamp?: string | undefined;
9683
+ endTimestamp?: string | undefined;
9684
+ tokenAddress?: string | undefined;
9685
+ mainParameter?: string | undefined;
9686
+ campaignId?: string | undefined;
9687
+ opportunityId?: string | undefined;
9688
+ test?: boolean | undefined;
9689
+ creatorTag?: string | undefined;
9690
+ tokenSymbol?: string | undefined;
9691
+ };
9692
+ fetch?: RequestInit | undefined;
9693
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
9694
+ [x: string]: any;
9695
+ 200: any;
9696
+ }>>;
9697
+ };
9480
9698
  };
9481
9699
  "campaign-status": ((params: {
9482
9700
  campaignId: string | number;
@@ -9797,12 +10015,23 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
9797
10015
  amount: string;
9798
10016
  rewardToken: string;
9799
10017
  campaignType: number;
9800
- }, options?: {
10018
+ }, options: {
9801
10019
  headers?: Record<string, unknown> | undefined;
9802
- query?: Record<string, unknown> | undefined;
10020
+ query: {
10021
+ debug?: boolean | undefined;
10022
+ };
9803
10023
  fetch?: RequestInit | undefined;
9804
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
10024
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
9805
10025
  200: {
10026
+ version: string;
10027
+ chainId: string;
10028
+ createdAt: number;
10029
+ meta: {
10030
+ name: string;
10031
+ txBuilderVersion: string;
10032
+ };
10033
+ transactions: import("../modules/v4/programPayload").transaction[];
10034
+ } | {
9806
10035
  safePayload: import("../modules/v4/programPayload").safePayload;
9807
10036
  nonEncodedConfig: any;
9808
10037
  };
@@ -2797,6 +2797,78 @@ declare const app: Elysia<"", false, {
2797
2797
  };
2798
2798
  };
2799
2799
  };
2800
+ } & {
2801
+ "dynamic-data": {
2802
+ "from-config": {
2803
+ post: {
2804
+ body: {
2805
+ id?: string | undefined;
2806
+ tags?: string[] | undefined;
2807
+ identifier?: string | undefined;
2808
+ subType?: number | undefined;
2809
+ chain?: {} | undefined;
2810
+ chainId?: number | undefined;
2811
+ startTimestamp?: string | undefined;
2812
+ endTimestamp?: string | undefined;
2813
+ distributionChainId?: number | undefined;
2814
+ campaignId?: string | undefined;
2815
+ rewardTokenId?: string | undefined;
2816
+ amount?: string | undefined;
2817
+ opportunityId?: string | undefined;
2818
+ creatorAddress?: string | undefined;
2819
+ campaignStatus?: {} | undefined;
2820
+ rewardToken?: {} | undefined;
2821
+ rewardTokenAddress?: string | undefined;
2822
+ distributionChain?: {} | undefined;
2823
+ opportunityIdentifier?: string | undefined;
2824
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST";
2825
+ params: {};
2826
+ computeChainId: number;
2827
+ };
2828
+ params: {};
2829
+ query: unknown;
2830
+ headers: {
2831
+ authorization: string;
2832
+ };
2833
+ response: {
2834
+ [x: string]: any;
2835
+ 200: any;
2836
+ };
2837
+ };
2838
+ };
2839
+ };
2840
+ } & {
2841
+ "dynamic-data": {
2842
+ "from-existing": {
2843
+ get: {
2844
+ body: unknown;
2845
+ params: {};
2846
+ query: {
2847
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST" | undefined;
2848
+ items?: number | undefined;
2849
+ subType?: number | undefined;
2850
+ page?: number | undefined;
2851
+ chainId?: number | undefined;
2852
+ startTimestamp?: string | undefined;
2853
+ endTimestamp?: string | undefined;
2854
+ tokenAddress?: string | undefined;
2855
+ mainParameter?: string | undefined;
2856
+ campaignId?: string | undefined;
2857
+ opportunityId?: string | undefined;
2858
+ test?: boolean | undefined;
2859
+ creatorTag?: string | undefined;
2860
+ tokenSymbol?: string | undefined;
2861
+ };
2862
+ headers: {
2863
+ authorization: string;
2864
+ };
2865
+ response: {
2866
+ [x: string]: any;
2867
+ 200: any;
2868
+ };
2869
+ };
2870
+ };
2871
+ };
2800
2872
  };
2801
2873
  } & {
2802
2874
  v4: {
@@ -3189,10 +3261,21 @@ declare const app: Elysia<"", false, {
3189
3261
  campaignType: number;
3190
3262
  };
3191
3263
  params: {};
3192
- query: unknown;
3264
+ query: {
3265
+ debug?: boolean | undefined;
3266
+ };
3193
3267
  headers: unknown;
3194
3268
  response: {
3195
3269
  200: {
3270
+ version: string;
3271
+ chainId: string;
3272
+ createdAt: number;
3273
+ meta: {
3274
+ name: string;
3275
+ txBuilderVersion: string;
3276
+ };
3277
+ transactions: import("./modules/v4/programPayload").transaction[];
3278
+ } | {
3196
3279
  safePayload: import("./modules/v4/programPayload").safePayload;
3197
3280
  nonEncodedConfig: any;
3198
3281
  };
@@ -1,4 +1,4 @@
1
- import { BN2Number, CTokenInterface, CompFork, CompoundSubCampaignType, IonicERC20_INTERFACE, LayerBankERC20Interface, YEAR, } from "@sdk";
1
+ import { BN2Number, CTokenInterface, CompFork, CompoundSubCampaignType, ERC20Interface, IonicERC20_INTERFACE, LayerBankERC20Interface, YEAR, } from "@sdk";
2
2
  import { log } from "../../../utils/logger";
3
3
  import { Pricer } from "../../../utils/pricer";
4
4
  export async function CompoundDynamicData(_chainId, campaigns) {
@@ -14,10 +14,24 @@ export async function CompoundDynamicData(_chainId, campaigns) {
14
14
  });
15
15
  }
16
16
  else {
17
+ if (campaign.campaignParameters.compFork === CompFork.LayerBank) {
18
+ calls.push({
19
+ allowFailure: true,
20
+ callData: LayerBankERC20Interface.encodeFunctionData("totalBorrow"),
21
+ target: campaign.campaignParameters.targetToken,
22
+ });
23
+ }
24
+ else {
25
+ calls.push({
26
+ allowFailure: true,
27
+ callData: CTokenInterface.encodeFunctionData("totalBorrows"),
28
+ target: campaign.campaignParameters.targetToken,
29
+ });
30
+ }
17
31
  calls.push({
18
32
  allowFailure: true,
19
- callData: CTokenInterface.encodeFunctionData("totalSupply"),
20
- target: campaign.campaignParameters.targetToken,
33
+ callData: ERC20Interface.encodeFunctionData("balanceOf", [campaign.campaignParameters.targetToken]),
34
+ target: campaign.campaignParameters.underlyingToken,
21
35
  });
22
36
  }
23
37
  }
@@ -48,13 +62,22 @@ export async function CompoundDynamicData(_chainId, campaigns) {
48
62
  const dynamicData = [];
49
63
  for (const campaign of campaigns) {
50
64
  let totalSupplyTargetToken;
65
+ let borrowedAmount;
66
+ let nonUtilizedSupplied;
51
67
  if (campaign.campaignSubType === CompoundSubCampaignType.supply) {
52
68
  try {
53
69
  if (campaign.campaignParameters.compFork === CompFork.Ionic) {
54
70
  totalSupplyTargetToken = BN2Number(IonicERC20_INTERFACE.decodeFunctionResult("getTotalUnderlyingSupplied", result[i++])[0], campaign.campaignParameters.decimalsUnderlyingToken);
55
71
  }
56
72
  else {
57
- totalSupplyTargetToken = BN2Number(CTokenInterface.decodeFunctionResult("totalSupply", result[i++])[0], campaign.campaignParameters.decimalsTargetToken);
73
+ if (campaign.campaignParameters.compFork === CompFork.LayerBank) {
74
+ borrowedAmount = BN2Number(LayerBankERC20Interface.decodeFunctionResult("totalBorrow", result[i++])[0], campaign.campaignParameters.decimalsUnderlyingToken);
75
+ }
76
+ else {
77
+ borrowedAmount = BN2Number(CTokenInterface.decodeFunctionResult("totalBorrows", result[i++])[0], campaign.campaignParameters.decimalsUnderlyingToken);
78
+ }
79
+ nonUtilizedSupplied = BN2Number(ERC20Interface.decodeFunctionResult("balanceOf", result[i++])[0], campaign.campaignParameters.decimalsUnderlyingToken);
80
+ totalSupplyTargetToken = borrowedAmount + nonUtilizedSupplied;
58
81
  }
59
82
  }
60
83
  catch {
@@ -18,18 +18,23 @@ export type callKeys = mandatoryCallKeys & {
18
18
  [key: string]: string;
19
19
  };
20
20
  export type mandatoryCallKeys = {
21
+ type: tokenType;
22
+ protocol: string;
21
23
  tokenAddress: string;
22
24
  blacklistedSupply: string;
23
25
  totalSupply: string;
24
26
  whitelistedSupply: string;
25
27
  };
26
28
  export type dataRaw = {
29
+ protocol: string;
27
30
  tokenAddress: string;
28
31
  blacklistedSupply: string;
29
32
  totalSupply: string;
30
33
  whitelistedSupply: string;
31
34
  };
32
35
  export type dataType = {
36
+ protocol: string;
37
+ type: tokenType;
33
38
  tokenAddress: string;
34
39
  totalSupply: number;
35
40
  blacklistedSupply: number;
@@ -39,6 +39,8 @@ export class GenericProcessor {
39
39
  const priceTargetToken = (await pricer.get({ symbol: campaign.campaignParameters.symbolTargetToken })) ?? 0;
40
40
  const tvl = whitelistedSupplyTargetToken * priceTargetToken;
41
41
  return {
42
+ protocol: typeInfo.protocol,
43
+ type,
42
44
  whitelistedSupplyTargetToken,
43
45
  totalSupply,
44
46
  priceTargetToken,
@@ -48,7 +50,7 @@ export class GenericProcessor {
48
50
  };
49
51
  }
50
52
  computeRound1(type, typeInfo) {
51
- typeInfo = { ...tokenTypeToProtocol[type], ...typeInfo };
53
+ typeInfo = { type, ...tokenTypeToProtocol[type], ...typeInfo };
52
54
  this.processingRound1(typeInfo);
53
55
  if (this.debug) {
54
56
  console.log("Round 1", {
@@ -37,6 +37,78 @@ export declare const DynamicDataController: Elysia<"/dynamic-data", false, {
37
37
  };
38
38
  };
39
39
  };
40
+ } & {
41
+ "dynamic-data": {
42
+ "from-config": {
43
+ post: {
44
+ body: {
45
+ id?: string | undefined;
46
+ tags?: string[] | undefined;
47
+ identifier?: string | undefined;
48
+ subType?: number | undefined;
49
+ chain?: {} | undefined;
50
+ chainId?: number | undefined;
51
+ startTimestamp?: string | undefined;
52
+ endTimestamp?: string | undefined;
53
+ distributionChainId?: number | undefined;
54
+ campaignId?: string | undefined;
55
+ rewardTokenId?: string | undefined;
56
+ amount?: string | undefined;
57
+ opportunityId?: string | undefined;
58
+ creatorAddress?: string | undefined;
59
+ campaignStatus?: {} | undefined;
60
+ rewardToken?: {} | undefined;
61
+ rewardTokenAddress?: string | undefined;
62
+ distributionChain?: {} | undefined;
63
+ opportunityIdentifier?: string | undefined;
64
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST";
65
+ params: {};
66
+ computeChainId: number;
67
+ };
68
+ params: {};
69
+ query: unknown;
70
+ headers: {
71
+ authorization: string;
72
+ };
73
+ response: {
74
+ [x: string]: any;
75
+ 200: any;
76
+ };
77
+ };
78
+ };
79
+ };
80
+ } & {
81
+ "dynamic-data": {
82
+ "from-existing": {
83
+ get: {
84
+ body: unknown;
85
+ params: {};
86
+ query: {
87
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "ERC20LOGPROCESSOR" | "ERC20REBASELOGPROCESSOR" | "VEST" | undefined;
88
+ items?: number | undefined;
89
+ subType?: number | undefined;
90
+ page?: number | undefined;
91
+ chainId?: number | undefined;
92
+ startTimestamp?: string | undefined;
93
+ endTimestamp?: string | undefined;
94
+ tokenAddress?: string | undefined;
95
+ mainParameter?: string | undefined;
96
+ campaignId?: string | undefined;
97
+ opportunityId?: string | undefined;
98
+ test?: boolean | undefined;
99
+ creatorTag?: string | undefined;
100
+ tokenSymbol?: string | undefined;
101
+ };
102
+ headers: {
103
+ authorization: string;
104
+ };
105
+ response: {
106
+ [x: string]: any;
107
+ 200: any;
108
+ };
109
+ };
110
+ };
111
+ };
40
112
  }, {
41
113
  derive: {};
42
114
  resolve: {};
@@ -1,7 +1,8 @@
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 { DynamicDataSourceIdentifier } from "./dynamicData.model";
4
+ import { GetCampaignQueryDto } from "../campaign";
5
+ import { DynamicDataSourceIdentifier, SimplifiedCampaignDto } from "./dynamicData.model";
5
6
  import { DynamicDataService } from "./dynamicData.service";
6
7
  // ─── DynamicDatas Controller ───────────────────────────────────────────────────────
7
8
  export const DynamicDataController = new Elysia({
@@ -16,4 +17,18 @@ export const DynamicDataController = new Elysia({
16
17
  BackOfficeGuard({ headers });
17
18
  throwOnUnsupportedChainId(query.chainId);
18
19
  },
20
+ })
21
+ .post("/from-config", async ({ body }) => await DynamicDataService.queryDynamicData(body), {
22
+ body: SimplifiedCampaignDto,
23
+ headers: AuthorizationHeadersDto,
24
+ beforeHandle: ({ headers }) => {
25
+ BackOfficeGuard({ headers });
26
+ },
27
+ })
28
+ .get("/from-existing", async ({ query }) => await DynamicDataService.queryDynamicDataFromCampaignId(query), {
29
+ query: GetCampaignQueryDto,
30
+ headers: AuthorizationHeadersDto,
31
+ beforeHandle: ({ headers }) => {
32
+ BackOfficeGuard({ headers });
33
+ },
19
34
  });