@merkl/api 0.17.23 → 0.17.24

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.
@@ -6930,7 +6930,9 @@ declare const eden: {
6930
6930
  dolomite: {
6931
6931
  get: (options: {
6932
6932
  headers?: Record<string, unknown> | undefined;
6933
- query: {};
6933
+ query: {
6934
+ chainId: number;
6935
+ };
6934
6936
  fetch?: RequestInit | undefined;
6935
6937
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
6936
6938
  [x: string]: any;
@@ -11767,7 +11769,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
11767
11769
  get: {
11768
11770
  body: unknown;
11769
11771
  params: {};
11770
- query: {};
11772
+ query: {
11773
+ chainId: number;
11774
+ };
11771
11775
  headers: unknown;
11772
11776
  response: {
11773
11777
  [x: string]: any;
@@ -19233,7 +19237,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
19233
19237
  dolomite: {
19234
19238
  get: (options: {
19235
19239
  headers?: Record<string, unknown> | undefined;
19236
- query: {};
19240
+ query: {
19241
+ chainId: number;
19242
+ };
19237
19243
  fetch?: RequestInit | undefined;
19238
19244
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
19239
19245
  [x: string]: any;
@@ -4418,7 +4418,9 @@ declare const app: Elysia<"", false, {
4418
4418
  get: {
4419
4419
  body: unknown;
4420
4420
  params: {};
4421
- query: {};
4421
+ query: {
4422
+ chainId: number;
4423
+ };
4422
4424
  headers: unknown;
4423
4425
  response: {
4424
4426
  [x: string]: any;
@@ -1,7 +1,8 @@
1
+ import { DOLOMITE_MARGIN_MAPPING } from "@sdk";
1
2
  export type DolomiteMarketT = {
2
3
  index: number;
3
4
  token: string;
4
5
  symbol: string;
5
6
  }[];
6
- export declare const getDomiteMarkets: () => Promise<DolomiteMarketT>;
7
- export declare const getDolomiteMarketWithCache: () => Promise<DolomiteMarketT>;
7
+ export declare const getDomiteMarkets: (chainId: keyof typeof DOLOMITE_MARGIN_MAPPING) => Promise<DolomiteMarketT>;
8
+ export declare const getDolomiteMarketWithCache: (chainId: keyof typeof DOLOMITE_MARGIN_MAPPING) => Promise<DolomiteMarketT>;
@@ -1,19 +1,22 @@
1
1
  import { Redis } from "../../../cache";
2
- import { DOLOMITE_CHAINID, DOLOMITE_MARGIN, DolomiteInterface, DolomiteMargin__factory, ERC20Interface } from "@sdk";
2
+ import { DOLOMITE_MARGIN_MAPPING, DolomiteInterface, DolomiteMargin__factory, ERC20Interface } from "@sdk";
3
3
  import { batchMulticallCallWithRetry } from "../../../utils/generic";
4
4
  import { providers } from "../../../utils/providers";
5
- export const getDomiteMarkets = async () => {
6
- const dolomiteMarginContract = await DolomiteMargin__factory.connect(DOLOMITE_MARGIN, providers[DOLOMITE_CHAINID]);
5
+ export const getDomiteMarkets = async (chainId) => {
6
+ if (!DOLOMITE_MARGIN_MAPPING[chainId]) {
7
+ throw "Dolomite is not supported on this chain";
8
+ }
9
+ const dolomiteMarginContract = await DolomiteMargin__factory.connect(DOLOMITE_MARGIN_MAPPING[chainId], providers[chainId]);
7
10
  const numMarkets = (await dolomiteMarginContract.getNumMarkets()).toNumber();
8
11
  const calls = [];
9
12
  for (let index = 0; index < numMarkets; index++) {
10
13
  calls.push({
11
14
  allowFailure: true,
12
15
  callData: DolomiteInterface.encodeFunctionData("getMarket", [index]),
13
- target: DOLOMITE_MARGIN,
16
+ target: DOLOMITE_MARGIN_MAPPING[chainId],
14
17
  });
15
18
  }
16
- const res = await batchMulticallCallWithRetry(DOLOMITE_CHAINID, {
19
+ const res = await batchMulticallCallWithRetry(chainId, {
17
20
  calls,
18
21
  });
19
22
  if (!res.every(r => r.success)) {
@@ -29,7 +32,7 @@ export const getDomiteMarkets = async () => {
29
32
  target: token,
30
33
  });
31
34
  }
32
- const secondRes = await batchMulticallCallWithRetry(DOLOMITE_CHAINID, {
35
+ const secondRes = await batchMulticallCallWithRetry(chainId, {
33
36
  calls: secondCalls,
34
37
  });
35
38
  for (let index = 0; index < numMarkets; index++) {
@@ -47,4 +50,4 @@ export const getDomiteMarkets = async () => {
47
50
  }
48
51
  return markets;
49
52
  };
50
- export const getDolomiteMarketWithCache = async () => await Redis.getOrSet("DolomiteMarkets", getDomiteMarkets);
53
+ export const getDolomiteMarketWithCache = async (chainId) => await Redis.getOrSet("DolomiteMarkets", getDomiteMarkets, chainId);
@@ -818,7 +818,7 @@ const SwapxInterfaceCampaigns = {
818
818
  hooks: [],
819
819
  poolAddress: "0xDd35c88B1754879EF86BBF3A24F81fCCA5Eb6B5D",
820
820
  whitelist: ["0x640429B0633851F487639BcDd8Ed523DDf1Bbff8"],
821
- blacklist: [],
821
+ blacklist: ["0x646ab1E6D0939672f810781449650A8058BB3C18", "0x45D341eE986532E09266c4ff182f610FaE249b5D"],
822
822
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
823
823
  forwarders: [],
824
824
  isOutOfRangeIncentivized: false,
@@ -832,7 +832,7 @@ const SwapxInterfaceCampaigns = {
832
832
  hooks: [],
833
833
  poolAddress: "0xDd35c88B1754879EF86BBF3A24F81fCCA5Eb6B5D",
834
834
  whitelist: ["0x4604782BcD6F749B271Fc9d14BFd583be6e5a6cf"],
835
- blacklist: [],
835
+ blacklist: ["0x09AcA88Fc65Ea9BC94C9DDB2C48FC4265e2ba41A", "0xBd58346C2c19CA392f473d1C048c09A6353A2B50"],
836
836
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
837
837
  forwarders: [],
838
838
  isOutOfRangeIncentivized: false,
@@ -860,7 +860,7 @@ const SwapxInterfaceCampaigns = {
860
860
  hooks: [],
861
861
  poolAddress: "0xD760791B29e7894FB827A94Ca433254bb5aFB653",
862
862
  whitelist: ["0x2f9e2852de03c42c13d3dCdD2C57c0b3cF0382c1"],
863
- blacklist: [],
863
+ blacklist: ["0x90513c7e25330A208CCEfCd975C6F6E8237541d0", "0x8dd81BA99883491Db2070F8E3aD6AAA563D71457"],
864
864
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
865
865
  forwarders: [],
866
866
  isOutOfRangeIncentivized: false,
@@ -874,7 +874,7 @@ const SwapxInterfaceCampaigns = {
874
874
  hooks: [],
875
875
  poolAddress: "0xD760791B29e7894FB827A94Ca433254bb5aFB653",
876
876
  whitelist: ["0xC693c6fc1d2b44DfB5C5aa05Ca2b02A91DB97528"],
877
- blacklist: [],
877
+ blacklist: ["0x7D2EF0fa1b7b2d237079F3e680aaFa54aA63be91", "0xd1Cb5d8D24Df956eC6C74647730ED4b1507000da"],
878
878
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
879
879
  forwarders: [],
880
880
  isOutOfRangeIncentivized: false,
@@ -1028,7 +1028,7 @@ const SwapxInterfaceCampaigns = {
1028
1028
  hooks: [],
1029
1029
  poolAddress: "0x0d13400CC7c46D77a43957fE614ba58C827dfde6",
1030
1030
  whitelist: ["0x29985EE262a4C9D878AA6A9B9dC43f2FC87a81c6"],
1031
- blacklist: [],
1031
+ blacklist: ["0xA49883f4123c2a10bbdBf095950E7F64292E29bF", "0x0b900e9fd1A345c643E995c6Fea4a3Ce9FaDFcdf"],
1032
1032
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
1033
1033
  forwarders: [],
1034
1034
  isOutOfRangeIncentivized: false,
@@ -1042,7 +1042,7 @@ const SwapxInterfaceCampaigns = {
1042
1042
  hooks: [],
1043
1043
  poolAddress: "0x0d13400CC7c46D77a43957fE614ba58C827dfde6",
1044
1044
  whitelist: ["0x30Df881606c719916b99a0b5bc89e5eB338a226C"],
1045
- blacklist: [],
1045
+ blacklist: ["0xf9a6Bc526c39925485946FfD93923Ca0906ab8f2", "0xE5B85B2D6A765b64d23089039bB76198Cd65e0E1"],
1046
1046
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
1047
1047
  forwarders: [],
1048
1048
  isOutOfRangeIncentivized: false,
@@ -1,4 +1,7 @@
1
1
  import type Elysia from "elysia";
2
+ export declare const query: import("@sinclair/typebox").TObject<{
3
+ chainId: import("@sinclair/typebox").TNumber;
4
+ }>;
2
5
  export declare const response: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
3
6
  index: import("@sinclair/typebox").TNumber;
4
7
  token: import("@sinclair/typebox").TString;
@@ -21,7 +24,9 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
21
24
  get: {
22
25
  body: unknown;
23
26
  params: {};
24
- query: {};
27
+ query: {
28
+ chainId: number;
29
+ };
25
30
  headers: unknown;
26
31
  response: {
27
32
  [x: string]: any;
@@ -1,9 +1,12 @@
1
1
  import { t } from "elysia";
2
2
  import { getDolomiteMarketWithCache } from "../../libs/campaigns/utils/getDolomiteMarkets";
3
+ export const query = t.Object({
4
+ chainId: t.Numeric(),
5
+ });
3
6
  export const response = t.Array(t.Object({ index: t.Number(), token: t.String(), symbol: t.String() }));
4
- export default (app) => app.get("/dolomite", async () => {
5
- return await getDolomiteMarketWithCache();
7
+ export default (app) => app.get("/dolomite", async ({ query }) => {
8
+ return await getDolomiteMarketWithCache(query.chainId);
6
9
  }, {
7
- query: t.Object({}),
10
+ query: query,
8
11
  tags: ["Protocols"],
9
12
  });
@@ -219,7 +219,9 @@ export declare const v3: Elysia<"/v3", false, {
219
219
  get: {
220
220
  body: unknown;
221
221
  params: {};
222
- query: {};
222
+ query: {
223
+ chainId: number;
224
+ };
223
225
  headers: unknown;
224
226
  response: {
225
227
  [x: string]: any;