@merkl/api 0.10.210 → 0.10.212

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/database/api/seeder/resources/protocol.d.ts +15 -0
  2. package/dist/database/api/seeder/resources/protocol.js +15 -1
  3. package/dist/src/eden/index.d.ts +192 -0
  4. package/dist/src/entities/opportunity.js +2 -1
  5. package/dist/src/index.d.ts +74 -0
  6. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +2 -1
  7. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +4 -0
  8. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/curveNPoolProcessor.d.ts +39 -0
  9. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/curveNPoolProcessor.js +81 -0
  10. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +2 -0
  11. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +4 -1
  12. package/dist/src/modules/v4/campaign/campaign.model.d.ts +2 -0
  13. package/dist/src/modules/v4/campaign/campaign.model.js +2 -0
  14. package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +1 -0
  15. package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +1 -0
  16. package/dist/src/modules/v4/dynamicData/dynamicData.service.js +1 -0
  17. package/dist/src/modules/v4/opportunity/opportunity.service.js +3 -0
  18. package/dist/src/modules/v4/opportunity/subservices/getEigenLayerMetadata.service.d.ts +3 -0
  19. package/dist/src/modules/v4/opportunity/subservices/getEigenLayerMetadata.service.js +9 -0
  20. package/dist/src/modules/v4/programPayload/index.d.ts +3 -0
  21. package/dist/src/modules/v4/programPayload/index.js +3 -0
  22. package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +93 -0
  23. package/dist/src/modules/v4/programPayload/programPayload.controller.js +38 -0
  24. package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +122 -0
  25. package/dist/src/modules/v4/programPayload/programPayload.model.js +130 -0
  26. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +39 -0
  27. package/dist/src/modules/v4/programPayload/programPayload.repository.js +359 -0
  28. package/dist/src/modules/v4/programPayload/programPayload.service.d.ts +8 -0
  29. package/dist/src/modules/v4/programPayload/programPayload.service.js +92 -0
  30. package/dist/src/modules/v4/router.d.ts +74 -0
  31. package/dist/src/modules/v4/router.js +3 -1
  32. package/dist/src/utils/decodeCalls.js +5 -3
  33. package/dist/src/utils/encodeCalls.js +11 -13
  34. package/dist/src/utils/generateCardName.js +2 -0
  35. package/dist/tsconfig.package.tsbuildinfo +1 -1
  36. package/package.json +1 -1
@@ -0,0 +1,93 @@
1
+ import Elysia from "elysia";
2
+ export declare const ProgramPayloadController: Elysia<"/program-payload", false, {
3
+ decorator: {};
4
+ store: {};
5
+ derive: {};
6
+ resolve: {};
7
+ }, {
8
+ type: {};
9
+ error: {};
10
+ }, {
11
+ schema: {};
12
+ macro: {};
13
+ macroFn: {};
14
+ }, {
15
+ "program-payload": {
16
+ index: {
17
+ get: {
18
+ body: unknown;
19
+ params: {};
20
+ query: {
21
+ creator: string;
22
+ startTimestamp: number;
23
+ endTimestamp: number;
24
+ campaign: string;
25
+ distributionChainId: number;
26
+ amount: string;
27
+ rewardToken: string;
28
+ program: string;
29
+ };
30
+ headers: unknown;
31
+ response: {
32
+ [x: string]: any;
33
+ 200: any;
34
+ };
35
+ };
36
+ };
37
+ };
38
+ } & {
39
+ "program-payload": {
40
+ config: {
41
+ get: {
42
+ body: unknown;
43
+ params: {};
44
+ query: {
45
+ creator: string;
46
+ startTimestamp: number;
47
+ endTimestamp: number;
48
+ campaign: string;
49
+ distributionChainId: number;
50
+ amount: string;
51
+ rewardToken: string;
52
+ program: string;
53
+ };
54
+ headers: unknown;
55
+ response: {
56
+ [x: string]: any;
57
+ 200: any;
58
+ };
59
+ };
60
+ };
61
+ };
62
+ } & {
63
+ "program-payload": {
64
+ program: {
65
+ get: {
66
+ body: unknown;
67
+ params: {};
68
+ query: {
69
+ creator: string;
70
+ startTimestamp: number;
71
+ endTimestamp: number;
72
+ distributionChainId: number;
73
+ amount: string;
74
+ rewardToken: string;
75
+ program: string;
76
+ };
77
+ headers: unknown;
78
+ response: {
79
+ [x: string]: any;
80
+ 200: any;
81
+ };
82
+ };
83
+ };
84
+ };
85
+ }, {
86
+ derive: {};
87
+ resolve: {};
88
+ schema: {};
89
+ }, {
90
+ derive: {};
91
+ resolve: {};
92
+ schema: {};
93
+ }>;
@@ -0,0 +1,38 @@
1
+ // import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
2
+ import Elysia from "elysia";
3
+ import { throwOnUnsupportedChainId } from "src/utils/throw";
4
+ import { CampaignPayloadInputDto, ProgramPayloadInputDto } from "./programPayload.model";
5
+ import { ProgramPayloadService } from "./programPayload.service";
6
+ // ─── ProgramPaylod Controller ───────────────────────────────────────────────────────
7
+ export const ProgramPayloadController = new Elysia({ prefix: "/program-payload", detail: { tags: ["ProgramPayload"] } })
8
+ // ─── Get payload for a specific campaign key ───────────────────────────────────────
9
+ .get("/", async ({ query }) => {
10
+ return ProgramPayloadService.buildPayload(query);
11
+ }, {
12
+ query: CampaignPayloadInputDto,
13
+ // headers: AuthorizationHeadersDto,
14
+ beforeHandle: ({ query, headers }) => {
15
+ // BackOfficeGuard({ headers });
16
+ throwOnUnsupportedChainId(query.distributionChainId);
17
+ },
18
+ })
19
+ .get("/config", async ({ query }) => {
20
+ return ProgramPayloadService.buildConfig(query);
21
+ }, {
22
+ query: CampaignPayloadInputDto,
23
+ // headers: AuthorizationHeadersDto,
24
+ beforeHandle: ({ query, headers }) => {
25
+ // BackOfficeGuard({ headers });
26
+ throwOnUnsupportedChainId(query.distributionChainId);
27
+ },
28
+ })
29
+ .get("/program", async ({ query }) => {
30
+ return ProgramPayloadService.buildProgramPayload(query);
31
+ }, {
32
+ query: ProgramPayloadInputDto,
33
+ // headers: AuthorizationHeadersDto,
34
+ beforeHandle: ({ query, headers }) => {
35
+ // BackOfficeGuard({ headers });
36
+ throwOnUnsupportedChainId(query.distributionChainId);
37
+ },
38
+ });
@@ -0,0 +1,122 @@
1
+ import type { Campaign, Forwarder, ForwarderParameters, HOOK, HookParameters, MerklChainId, MorphoSubCampaignType } from "@sdk";
2
+ export declare const CampaignPayloadInputDto: import("@sinclair/typebox").TObject<{
3
+ campaign: import("@sinclair/typebox").TString;
4
+ program: import("@sinclair/typebox").TString;
5
+ creator: import("@sinclair/typebox").TString;
6
+ rewardToken: import("@sinclair/typebox").TString;
7
+ distributionChainId: import("@sinclair/typebox").TNumber;
8
+ startTimestamp: import("@sinclair/typebox").TNumber;
9
+ endTimestamp: import("@sinclair/typebox").TNumber;
10
+ amount: import("@sinclair/typebox").TString;
11
+ }>;
12
+ export declare const ProgramPayloadInputDto: import("@sinclair/typebox").TObject<{
13
+ program: import("@sinclair/typebox").TString;
14
+ creator: import("@sinclair/typebox").TString;
15
+ rewardToken: import("@sinclair/typebox").TString;
16
+ distributionChainId: import("@sinclair/typebox").TNumber;
17
+ startTimestamp: import("@sinclair/typebox").TNumber;
18
+ endTimestamp: import("@sinclair/typebox").TNumber;
19
+ amount: import("@sinclair/typebox").TString;
20
+ }>;
21
+ export type CampaignPayloadInputModel = typeof CampaignPayloadInputDto.static;
22
+ export type ProgramPayloadInputModel = typeof ProgramPayloadInputDto.static;
23
+ export type partialConfigERC20 = {
24
+ computeChainId?: MerklChainId;
25
+ hooks?: (HookParameters<HOOK> | string)[];
26
+ campaignType: Campaign;
27
+ targetToken: string;
28
+ whitelist: string[];
29
+ blacklist: string[];
30
+ url?: string;
31
+ forwarders: ForwarderParameters<Forwarder>[];
32
+ };
33
+ export type partialConfigMorpho = {
34
+ computeChainId?: MerklChainId;
35
+ hooks?: (HookParameters<HOOK> | string)[];
36
+ campaignType: Campaign;
37
+ whitelist: string[];
38
+ blacklist: string[];
39
+ forwarders: ForwarderParameters<Forwarder>[];
40
+ } & ({
41
+ subCampaignType: MorphoSubCampaignType.META;
42
+ targetToken: string;
43
+ } | {
44
+ subCampaignType: MorphoSubCampaignType.SUPPLY_BLUE | MorphoSubCampaignType.COLLATERAL_BLUE | MorphoSubCampaignType.BORROWING_BLUE;
45
+ marketId: string;
46
+ });
47
+ export type partialConfigCLAMM = {
48
+ computeChainId?: MerklChainId;
49
+ hooks?: (HookParameters<HOOK> | string)[];
50
+ campaignType: Campaign;
51
+ poolAddress: string;
52
+ isOutOfRangeIncentivized: boolean;
53
+ weightFees: number;
54
+ weightToken0: number;
55
+ weightToken1: number;
56
+ whitelist: string[];
57
+ blacklist: string[];
58
+ url?: string;
59
+ };
60
+ export type partialConfig = partialConfigERC20 | partialConfigMorpho | partialConfigCLAMM;
61
+ export declare const safeTemplate: {
62
+ version: string;
63
+ chainId: string;
64
+ createdAt: number;
65
+ meta: {
66
+ name: string;
67
+ txBuilderVersion: string;
68
+ };
69
+ transactions: ({
70
+ to: string;
71
+ value: string;
72
+ data: null;
73
+ contractMethod: {
74
+ inputs: {
75
+ name: string;
76
+ type: string;
77
+ internalType: string;
78
+ }[];
79
+ name: string;
80
+ payable: boolean;
81
+ };
82
+ contractInputsValues: {
83
+ spender: string;
84
+ amount: string;
85
+ newCampaign?: undefined;
86
+ };
87
+ } | {
88
+ to: string;
89
+ value: string;
90
+ data: null;
91
+ contractMethod: {
92
+ inputs: never[];
93
+ name: string;
94
+ payable: boolean;
95
+ };
96
+ contractInputsValues: null;
97
+ } | {
98
+ to: string;
99
+ value: string;
100
+ data: null;
101
+ contractMethod: {
102
+ inputs: {
103
+ components: {
104
+ internalType: string;
105
+ name: string;
106
+ type: string;
107
+ }[];
108
+ internalType: string;
109
+ name: string;
110
+ type: string;
111
+ }[];
112
+ name: string;
113
+ payable: boolean;
114
+ };
115
+ contractInputsValues: {
116
+ newCampaign: string;
117
+ spender?: undefined;
118
+ amount?: undefined;
119
+ };
120
+ })[];
121
+ };
122
+ export type safeTemplate = typeof safeTemplate;
@@ -0,0 +1,130 @@
1
+ import { t } from "elysia";
2
+ // ─── DTOs ────────────────────────────────────────────────────────────────────
3
+ export const CampaignPayloadInputDto = t.Object({
4
+ campaign: t.String(),
5
+ program: t.String(),
6
+ creator: t.String(),
7
+ rewardToken: t.String(),
8
+ distributionChainId: t.Numeric(),
9
+ startTimestamp: t.Numeric(),
10
+ endTimestamp: t.Numeric(),
11
+ amount: t.String(),
12
+ });
13
+ export const ProgramPayloadInputDto = t.Object({
14
+ program: t.String(),
15
+ creator: t.String(),
16
+ rewardToken: t.String(),
17
+ distributionChainId: t.Numeric(),
18
+ startTimestamp: t.Numeric(),
19
+ endTimestamp: t.Numeric(),
20
+ amount: t.String(),
21
+ });
22
+ // ---- Template below ----
23
+ export const safeTemplate = {
24
+ version: "1.0",
25
+ chainId: "100",
26
+ createdAt: 1708537104580,
27
+ meta: {
28
+ name: "Create Merkl Campaign",
29
+ txBuilderVersion: "1.16.3",
30
+ },
31
+ transactions: [
32
+ {
33
+ to: "0x4200000000000000000000000000000000000042",
34
+ value: "0",
35
+ data: null,
36
+ contractMethod: {
37
+ inputs: [
38
+ {
39
+ name: "spender",
40
+ type: "address",
41
+ internalType: "address",
42
+ },
43
+ {
44
+ name: "amount",
45
+ type: "uint256",
46
+ internalType: "uint256",
47
+ },
48
+ ],
49
+ name: "approve",
50
+ payable: false,
51
+ },
52
+ contractInputsValues: {
53
+ spender: "0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd",
54
+ amount: "2000000000000000000000",
55
+ },
56
+ },
57
+ {
58
+ to: "0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd",
59
+ value: "0",
60
+ data: null,
61
+ contractMethod: {
62
+ inputs: [],
63
+ name: "acceptConditions",
64
+ payable: false,
65
+ },
66
+ contractInputsValues: null,
67
+ },
68
+ {
69
+ to: "0x8BB4C975Ff3c250e0ceEA271728547f3802B36Fd",
70
+ value: "0",
71
+ data: null,
72
+ contractMethod: {
73
+ inputs: [
74
+ {
75
+ components: [
76
+ {
77
+ internalType: "bytes32",
78
+ name: "campaignId",
79
+ type: "bytes32",
80
+ },
81
+ {
82
+ internalType: "address",
83
+ name: "creator",
84
+ type: "address",
85
+ },
86
+ {
87
+ internalType: "address",
88
+ name: "rewardToken",
89
+ type: "address",
90
+ },
91
+ {
92
+ internalType: "uint256",
93
+ name: "amount",
94
+ type: "uint256",
95
+ },
96
+ {
97
+ internalType: "uint32",
98
+ name: "campaignType",
99
+ type: "uint32",
100
+ },
101
+ {
102
+ internalType: "uint32",
103
+ name: "startTimestamp",
104
+ type: "uint32",
105
+ },
106
+ {
107
+ internalType: "uint32",
108
+ name: "duration",
109
+ type: "uint32",
110
+ },
111
+ {
112
+ internalType: "bytes",
113
+ name: "campaignData",
114
+ type: "bytes",
115
+ },
116
+ ],
117
+ internalType: "struct CampaignParameters",
118
+ name: "newCampaign",
119
+ type: "tuple",
120
+ },
121
+ ],
122
+ name: "createCampaign",
123
+ payable: false,
124
+ },
125
+ contractInputsValues: {
126
+ newCampaign: '["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000","0x31429d1856aD1377A8A0079410B297e1a9e214c2","1000000000000000000000",1,1676649600,0,"0x0000000000000000000000001a7e4e63778b4f12a199c062f3efdd288afcbce800000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"]',
127
+ },
128
+ },
129
+ ],
130
+ };
@@ -0,0 +1,39 @@
1
+ import type { partialConfig } from "./programPayload.model";
2
+ export declare enum program {
3
+ Puffer = "Puffer"
4
+ }
5
+ export declare enum campaigns {
6
+ Puffer_Zircuit_Restaking_Pool = "PufferProgram Zircuit Restaking Pool 0xF047ab4c75cebf0eB9ed34Ae2c186f3611aEAfa6",//
7
+ Puffer_Pendle_26_JUN_2025 = "PufferProgram Pendle 26 JUN 2025 0x784A0bb8208C70290cac6bcBC3650cEb9227813E",//
8
+ Puffer_Pendle_26_JUN_2025_YT = "PufferProgram YT Pendle 26 JUN 2025 0x784A0bb8208C70290cac6bcBC3650cEb9227813E",//
9
+ Puffer_Karak = "PufferProgram Karak 0x68754d29f2e97B837Cb622ccfF325adAC27E9977",//
10
+ Puffer_Curve_pufEth = "PufferProgram Curve pufEth 0xEEda34A377dD0ca676b9511EE1324974fA8d980D",//
11
+ Puffer_Morpho_pufETH_WETH = "PufferProgram Morpho Weth 0x0eed5a89c7d397d02fd0b9b8e42811ca67e50ed5aeaa4f22e506516c716cfbbf",//
12
+ Puffer_Pencils_ppufEth = "PufferProgram Pencils PufferVault 0x0C530882C0900b13FC6E8312B52c26e7a5b8e505",//
13
+ Puffer_Morpho_pufETH_USDC = "PufferProgram Morpho USDC 0x7e9c708876fa3816c46aeb08937b51aa0461c2af3865ecb306433db8a80b1d1b",//
14
+ Puffer_balancer_wstETH_pufETH = "PufferProgram Balancer Vault wstETH_pufETH 0x63E0d47A6964aD1565345Da9bfA66659F4983F02",//
15
+ Puffer_curve_llamalend = "PufferProgram Curve Llama wstETH 0xcd28cF8f7755f03967D27E128B38022B63919836",
16
+ Puffer_cyber_staking_pool = "PufferProgram Cyber Staking Pool 0x18eeD20f71BEf84B605253C89A7576E3634134C0",//
17
+ Puffer_aura_balancer_wstETH_pufETH = "PufferProgram Aura Balancer Vault wstETH_pufETH 0x6Ea41486A8f21EED7B20AfDB681b90a5B6C6D029",//
18
+ Puffer_kinza_pufETH = "PufferProgram Kinza Puf Eth 0x5651bb75dE3c78815D420602B4Ce67D04a233873",//
19
+ Puffer_zerolend_pufETH = "PufferProgram Zerolend Puf Eth 0xdD7Afc0f014A1E1716307Ff040704fA12E8D33A3",//
20
+ Puffer_desyn_pufETH = "PufferProgram Desyn 0x3a8099D8FE5C072bB035381003993393072D3ec7",//
21
+ Puffer_gamma_swap_pufETH = "PufferProgram GammaSwap V1 0x1a33B9be3Fe58C1Bde4325A68c09C1F7fA8aA1e5",//
22
+ Puffer_Morpho_pufETH_USDA = "PufferProgram Morpho USDA 0xa42ba90e4d3013dee8eb0d7bb7ae0817297337eeecd525dbdd48c7b5c5e6988d",
23
+ Puffer_pufETH_hold = "PufferProgram pufETH Hold 0xD9A442856C234a39a81a089C06451EBAa4306a72",//
24
+ Puffer_unifiETH_hold = "PufferProgram unifiETH Hold 0x196ead472583Bc1e9aF7A05F860D9857e1Bd3dCc",//
25
+ Puffer_vePuffer = "PufferProgram vePuffer 0x4d1C297d39C5c1277964D0E3f8Aa901493664530",//
26
+ Puffer_mindNetwork_pufETH = "PufferProgram Mind Network 0x0124183e894aED6558c445Ff125801753e834216",//
27
+ Puffer_pancakeSwap_xpufEth = "PufferProgram PancakeSwap xPufEth 0x2b8d093f22f7b6f53d02aca106de3eabc0937d45",//
28
+ Puffer_aerodrome_cl50_xpufETH = "PufferProgram Aerodrome CL50-xpufETH / WETH 0xCDf927C0F7b81b146C0C9e9323eb5A28D1BFA183",//
29
+ Puffer_uniswapv3_eth_pufETH = "PufferProgram Uniswap V3 eth_pufETH 0xBDB04e915B94FbFD6e8552ff7860E59Db7d4499a",//
30
+ Puffer_uniswapv3_weth_PUFFER = "PufferProgram Uniswap V3 weth_PUFFER 0xc5c9a9AB6403CDBa9722463000146C18b504F0bA",//
31
+ Puffer_uniswapv3_vt_weth = "PufferProgram Uniswap V3 vt_eth 0xa56600e670724b42F38d3A6e4B25e8D786B4F5f9"
32
+ }
33
+ declare const PufferInterfaceCampaigns: {
34
+ [key in campaigns]: partialConfig;
35
+ };
36
+ export declare const MerklInterfaceCampaigns: {
37
+ [key in program]: typeof PufferInterfaceCampaigns;
38
+ };
39
+ export {};