@merkl/api 0.10.243 → 0.10.245

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.
@@ -2140,11 +2140,11 @@ declare const eden: {
2140
2140
  get: (options: {
2141
2141
  headers?: Record<string, unknown> | undefined;
2142
2142
  query: {
2143
+ amount?: string | undefined;
2143
2144
  creator: string;
2144
2145
  startTimestamp: number;
2145
2146
  endTimestamp: number;
2146
2147
  distributionChainId: number;
2147
- amount: string;
2148
2148
  rewardToken: string;
2149
2149
  program: string;
2150
2150
  };
@@ -5411,11 +5411,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5411
5411
  body: unknown;
5412
5412
  params: {};
5413
5413
  query: {
5414
+ amount?: string | undefined;
5414
5415
  creator: string;
5415
5416
  startTimestamp: number;
5416
5417
  endTimestamp: number;
5417
5418
  distributionChainId: number;
5418
- amount: string;
5419
5419
  rewardToken: string;
5420
5420
  program: string;
5421
5421
  };
@@ -8328,11 +8328,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8328
8328
  get: (options: {
8329
8329
  headers?: Record<string, unknown> | undefined;
8330
8330
  query: {
8331
+ amount?: string | undefined;
8331
8332
  creator: string;
8332
8333
  startTimestamp: number;
8333
8334
  endTimestamp: number;
8334
8335
  distributionChainId: number;
8335
- amount: string;
8336
8336
  rewardToken: string;
8337
8337
  program: string;
8338
8338
  };
@@ -2671,11 +2671,11 @@ declare const app: Elysia<"", false, {
2671
2671
  body: unknown;
2672
2672
  params: {};
2673
2673
  query: {
2674
+ amount?: string | undefined;
2674
2675
  creator: string;
2675
2676
  startTimestamp: number;
2676
2677
  endTimestamp: number;
2677
2678
  distributionChainId: number;
2678
- amount: string;
2679
2679
  rewardToken: string;
2680
2680
  program: string;
2681
2681
  };
@@ -1,4 +1,4 @@
1
- import { ETH_ZKSYNC_ADDRESS } from "@sdk";
1
+ import { ETH_ADDRESS, ETH_ZKSYNC_ADDRESS } from "@sdk";
2
2
  import { decodeFunctionResult, encodeFunctionData, parseAbi } from "viem";
3
3
  import { ChainInteractionService } from "../chainInteraction";
4
4
  import { EnsoService } from "../enso/enso.service";
@@ -64,7 +64,7 @@ export class InteractionService {
64
64
  static async getApproval(chainId, owner, spender, tokenAddress, amount) {
65
65
  // Normalizing ETH on ZKSync
66
66
  if (tokenAddress === ETH_ZKSYNC_ADDRESS)
67
- tokenAddress = ETH_ZKSYNC_ADDRESS;
67
+ tokenAddress = ETH_ADDRESS;
68
68
  //TODO: add utils to make using viem type-safety more concise
69
69
  const abi = parseAbi([
70
70
  "function approve(address, uint256) returns (bool)",
@@ -101,7 +101,7 @@ export class InteractionService {
101
101
  static async getTransaction(provider, chainId, protocolId, identifier, userAddress, fromTokenAddress, fromTokenAmount, slippage) {
102
102
  // Normalizing ETH on ZKSync
103
103
  if (fromTokenAddress === ETH_ZKSYNC_ADDRESS)
104
- fromTokenAddress = ETH_ZKSYNC_ADDRESS;
104
+ fromTokenAddress = ETH_ADDRESS;
105
105
  if (provider === "zap")
106
106
  return await KyberZapService.getTransaction(chainId, protocolId, identifier, userAddress, fromTokenAddress, fromTokenAmount, slippage);
107
107
  const { tx, ...quote } = await EnsoService.getTransaction({
@@ -66,11 +66,11 @@ export declare const ProgramPayloadController: Elysia<"/program-payload", false,
66
66
  body: unknown;
67
67
  params: {};
68
68
  query: {
69
+ amount?: string | undefined;
69
70
  creator: string;
70
71
  startTimestamp: number;
71
72
  endTimestamp: number;
72
73
  distributionChainId: number;
73
- amount: string;
74
74
  rewardToken: string;
75
75
  program: string;
76
76
  };
@@ -36,3 +36,17 @@ export const ProgramPayloadController = new Elysia({ prefix: "/program-payload",
36
36
  throwOnUnsupportedChainId(query.distributionChainId);
37
37
  },
38
38
  });
39
+ // TO DO FIX
40
+ // .get(
41
+ // "/program/withAmounts",
42
+ // async ({ query, body }) => {
43
+ // return ProgramPayloadService.buildProgramPayloadWithAmounts(query, body);
44
+ // },
45
+ // {
46
+ // query: ProgramPayloadInputDto,
47
+ // body: CampaignAmountsInputDto,
48
+ // beforeHandle: ({ query }) => {
49
+ // throwOnUnsupportedChainId(query.distributionChainId);
50
+ // },
51
+ // }
52
+ // )
@@ -16,8 +16,9 @@ export declare const ProgramPayloadInputDto: import("@sinclair/typebox").TObject
16
16
  distributionChainId: import("@sinclair/typebox").TNumber;
17
17
  startTimestamp: import("@sinclair/typebox").TNumber;
18
18
  endTimestamp: import("@sinclair/typebox").TNumber;
19
- amount: import("@sinclair/typebox").TString;
19
+ amount: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
20
20
  }>;
21
+ export declare const CampaignAmountsInputDto: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
21
22
  export type CampaignPayloadInputModel = typeof CampaignPayloadInputDto.static;
22
23
  export type ProgramPayloadInputModel = typeof ProgramPayloadInputDto.static;
23
24
  export type partialConfigERC20 = {
@@ -17,8 +17,9 @@ export const ProgramPayloadInputDto = t.Object({
17
17
  distributionChainId: t.Numeric(),
18
18
  startTimestamp: t.Numeric(),
19
19
  endTimestamp: t.Numeric(),
20
- amount: t.String(),
20
+ amount: t.Optional(t.String()),
21
21
  });
22
+ export const CampaignAmountsInputDto = t.Record(t.String(), t.String());
22
23
  // ---- Template below ----
23
24
  export const safeTemplate = {
24
25
  version: "1.0",
@@ -87,6 +87,9 @@ export declare enum zkSyncCampaigns {
87
87
  ZKSwap_wstETH_ETH = "ZKSwap Finance wstETH/ETH v2 0.1pct 0x4848204d1ee4422d91d91b1c89f6d2f9ace09e2c",
88
88
  ZKSwap_ZK_ETH = "ZKSwap Finance ZK/ETH v2 0.1pct 0x9ee3178701d91cc7b01d5b2d2cae65ccb29b3de4"
89
89
  }
90
+ export declare const zkSyncCampaignAmounts: {
91
+ [key in zkSyncCampaigns]: string;
92
+ };
90
93
  declare const ZkSyncInterfaceCampaigns: {
91
94
  [key in zkSyncCampaigns]: partialConfig;
92
95
  };
@@ -90,6 +90,62 @@ export var zkSyncCampaigns;
90
90
  zkSyncCampaigns["ZKSwap_wstETH_ETH"] = "ZKSwap Finance wstETH/ETH v2 0.1pct 0x4848204d1ee4422d91d91b1c89f6d2f9ace09e2c";
91
91
  zkSyncCampaigns["ZKSwap_ZK_ETH"] = "ZKSwap Finance ZK/ETH v2 0.1pct 0x9ee3178701d91cc7b01d5b2d2cae65ccb29b3de4";
92
92
  })(zkSyncCampaigns || (zkSyncCampaigns = {}));
93
+ export const zkSyncCampaignAmounts = {
94
+ [zkSyncCampaigns.Vest_USDC]: "118018970000000000000000",
95
+ [zkSyncCampaigns.RFX_BTC_USD]: "74176350000000000000000",
96
+ [zkSyncCampaigns.RFX_ETH_USD]: "66330760000000000000000",
97
+ [zkSyncCampaigns.RFX_ZK_USD]: "147717380000000000000000",
98
+ [zkSyncCampaigns.HoldSation_USDC]: "194310570000000000000000",
99
+ [zkSyncCampaigns.ReactorFusion_ZK]: "206533192800000000000000",
100
+ [zkSyncCampaigns.ReactorFusion_WETH]: "19271527140000000000000",
101
+ [zkSyncCampaigns.ReactorFusion_USDCe]: "265542676500000000000000",
102
+ [zkSyncCampaigns.Zerolend_ZK]: "115068493200000000000000",
103
+ [zkSyncCampaigns.Zerolend_M_BTC]: "92662956090000000000000",
104
+ [zkSyncCampaigns.Zerolend_USDCe]: "265542676500000000000000",
105
+ [zkSyncCampaigns.Zerolend_WETH]: "19271527140000000000000",
106
+ [zkSyncCampaigns.Aave_WstETH]: "12692604260000000000000",
107
+ [zkSyncCampaigns.Aave_ZK]: "414246575300000000000000",
108
+ [zkSyncCampaigns.Aave_WETH]: "60404207990000000000000",
109
+ [zkSyncCampaigns.Aave_USDC]: "236037934700000000000000",
110
+ [zkSyncCampaigns.Venus_WETH]: "71050707600000000000000",
111
+ [zkSyncCampaigns.Venus_ZK]: "575342465800000000000000",
112
+ [zkSyncCampaigns.Venus_USDCe]: "383561643800000000000000",
113
+ [zkSyncCampaigns.Izumi_Finance_Zk_Weth]: "69689230000000000000000",
114
+ [zkSyncCampaigns.Izumi_Finance_WBTC_BTC]: "21636810000000000000000",
115
+ [zkSyncCampaigns.Izumi_Finance_WETH_USDC]: "13617150000000000000000",
116
+ [zkSyncCampaigns.Koi_Finance_ZK_WETH]: "69689230000000000000000",
117
+ [zkSyncCampaigns.Koi_Finance_USDCe_USDT]: "294925570000000000000000",
118
+ [zkSyncCampaigns.Koi_Finance_wETH_wstETH]: "26204750000000000000000",
119
+ [zkSyncCampaigns.Koi_Finance_wETH_wrsETH]: "26271720000000000000000",
120
+ [zkSyncCampaigns.Koi_Finance_USDCe_wETH]: "49174570000000000000000",
121
+ [zkSyncCampaigns.PancakeSwap_USDC_USDT]: "20662380000000000000000",
122
+ [zkSyncCampaigns.PancakeSwap_USDCe_wETH]: "7911820000000000000000",
123
+ [zkSyncCampaigns.PancakeSwap_USDCe_ZK]: "87111540000000000000000",
124
+ [zkSyncCampaigns.PancakeSwap_USDC_USDCe]: "38986880000000000000000",
125
+ [zkSyncCampaigns.PancakeSwap_wETH_wstETH]: "2727130000000000000000",
126
+ [zkSyncCampaigns.PancakeSwap_ZK_wETH]: "214290540000000000000000",
127
+ [zkSyncCampaigns.Uniswap_USDC_USDCe]: "23010450000000000000000",
128
+ [zkSyncCampaigns.Uniswap_USDC_ETH]: "11868770000000000000000",
129
+ [zkSyncCampaigns.Uniswap_USDCe_ZK]: "87111540000000000000000",
130
+ [zkSyncCampaigns.Uniswap_ZK_ETH]: "176255940000000000000000",
131
+ [zkSyncCampaigns.Maverick_USDC_USDCe_Boosted]: "25950680000000000000000",
132
+ [zkSyncCampaigns.Maverick_ETH_wstETH_Boosted]: "4607810000000000000000",
133
+ [zkSyncCampaigns.Maverick_ZK_ETH_Boosted]: "58074360000000000000000",
134
+ [zkSyncCampaigns.SyncSwap_wBTC_MBTC]: "21636810000000000000000",
135
+ [zkSyncCampaigns.SyncSwap_USDC_USDT]: "27590940000000000000000",
136
+ [zkSyncCampaigns.SyncSwap_USDC_USDCe]: "65878960000000000000000",
137
+ [zkSyncCampaigns.SyncSwap_wETH_wstETH]: "28781520000000000000000",
138
+ [zkSyncCampaigns.SyncSwap_ETH_wrsETH]: "43694580000000000000000",
139
+ [zkSyncCampaigns.SyncSwap_ZK_ETH]: "518397710000000000000000",
140
+ [zkSyncCampaigns.SyncSwap_USDCe_ETH]: "211179490000000000000000",
141
+ [zkSyncCampaigns.ZKSwap_wrsETH_ETH]: "5383140000000000000000",
142
+ [zkSyncCampaigns.ZKSwap_ETH_USDCe]: "59009480000000000000000",
143
+ [zkSyncCampaigns.ZKSwap_USDC_USDCe_USDT]: "108287010000000000000000",
144
+ [zkSyncCampaigns.ZKSwap_wstETH_ETH]: "4374570000000000000000",
145
+ [zkSyncCampaigns.ZKSwap_ZK_ETH]: "180672820000000000000000",
146
+ [zkSyncCampaigns.Woofi_ETH]: "9459810000000000000000",
147
+ [zkSyncCampaigns.Woofi_USDC]: "24796570000000000000000",
148
+ };
93
149
  const ZkSyncInterfaceCampaigns = {
94
150
  [zkSyncCampaigns.Vest_USDC]: {
95
151
  campaignType: Campaign.VEST,
@@ -1,7 +1,7 @@
1
1
  import { ChainId, NULL_ADDRESS, NULL_ROOT, buildCampaignPayload, encodeForwarderData, registry, } from "@sdk";
2
2
  import _ from "lodash";
3
3
  import { safeTemplate, } from "./programPayload.model";
4
- import { MerklInterfaceCampaigns } from "./programPayload.repository";
4
+ import { MerklInterfaceCampaigns, zkSyncCampaignAmounts } from "./programPayload.repository";
5
5
  export class ProgramPayloadService {
6
6
  // ─── ProgramPayload ──────────────────────────────────────────────────────────
7
7
  static buildConfig(query) {
@@ -84,7 +84,11 @@ export class ProgramPayloadService {
84
84
  static buildProgramPayload(query) {
85
85
  let campaignPayloads = null;
86
86
  for (const campaign of Object.keys(MerklInterfaceCampaigns[query.program])) {
87
- const queryCampaign = { ...query, campaign };
87
+ const queryCampaign = {
88
+ ...query,
89
+ campaign,
90
+ amount: query.amount || zkSyncCampaignAmounts[campaign],
91
+ };
88
92
  campaignPayloads = ProgramPayloadService.buildPayload(queryCampaign, campaignPayloads);
89
93
  }
90
94
  return campaignPayloads;
@@ -2549,11 +2549,11 @@ export declare const v4: Elysia<"/v4", false, {
2549
2549
  body: unknown;
2550
2550
  params: {};
2551
2551
  query: {
2552
+ amount?: string | undefined;
2552
2553
  creator: string;
2553
2554
  startTimestamp: number;
2554
2555
  endTimestamp: number;
2555
2556
  distributionChainId: number;
2556
- amount: string;
2557
2557
  rewardToken: string;
2558
2558
  program: string;
2559
2559
  };