@merkl/api 0.21.0 → 0.21.2

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.
@@ -150,4 +150,5 @@ export const processorMapping = {
150
150
  [Erc20SubType.sake_lending]: AaveProcessor,
151
151
  [Erc20SubType.gamma]: GammaALMProcessor,
152
152
  [Erc20SubType.stability]: StabilityProcessor,
153
+ [Erc20SubType.stability_lending]: AaveProcessor,
153
154
  };
@@ -169,8 +169,10 @@ function satisfiesNameConditions(name, type) {
169
169
  return lowerCaseName.includes("sake soneium");
170
170
  case Erc20SubType.sake_borrowing:
171
171
  return lowerCaseName.includes("sake soneium") && lowerCaseName.includes("debt");
172
+ case Erc20SubType.stability_lending:
173
+ return lowerCaseName.startsWith("stability market");
172
174
  case Erc20SubType.stability:
173
- return lowerCaseName.startsWith("stability");
175
+ return lowerCaseName.startsWith("stability") && !lowerCaseName.startsWith("stability market");
174
176
  default:
175
177
  return false;
176
178
  }
@@ -97,6 +97,10 @@ export const tokenTypeToProtocolAndAction = {
97
97
  protocol: "stability",
98
98
  action: OpportunityAction.HOLD,
99
99
  },
100
+ [Erc20SubType.stability_lending]: {
101
+ protocol: "stability",
102
+ action: OpportunityAction.LEND,
103
+ },
100
104
  [Erc20SubType.bunniV2]: {
101
105
  protocol: "bunni",
102
106
  action: OpportunityAction.HOLD,
@@ -107,6 +107,7 @@ export declare enum Erc20SubType {
107
107
  sake_lending = "sake_lending",
108
108
  gamma = "gamma",
109
109
  stability = "stability",
110
+ stability_lending = "stability_lending",
110
111
  lendle_vaults = "lendle_vaults",
111
112
  termmax = "termmax"
112
113
  }
@@ -106,6 +106,7 @@ export var Erc20SubType;
106
106
  Erc20SubType["sake_lending"] = "sake_lending";
107
107
  Erc20SubType["gamma"] = "gamma";
108
108
  Erc20SubType["stability"] = "stability";
109
+ Erc20SubType["stability_lending"] = "stability_lending";
109
110
  Erc20SubType["lendle_vaults"] = "lendle_vaults";
110
111
  Erc20SubType["termmax"] = "termmax";
111
112
  })(Erc20SubType || (Erc20SubType = {}));
@@ -96,7 +96,7 @@ export class EnsoService {
96
96
  const targets = await EnsoService.getTargetsFromTokens(tokens);
97
97
  return targets?.[0];
98
98
  },
99
- async getTransaction(chainId, protocolId, identifier, userAddress, fromTokenAddress, fromTokenAmount, options) {
99
+ async getTransaction(chainId, _protocolId, identifier, userAddress, fromTokenAddress, fromTokenAmount, options) {
100
100
  const { tx, ...quote } = await EnsoService.getTransaction({
101
101
  fromAddress: userAddress,
102
102
  tokenIn: [fromTokenAddress],
@@ -1,4 +1,5 @@
1
1
  import Elysia from "elysia";
2
+ import { isAddress } from "viem";
2
3
  import { EnsoService } from "../enso/enso.service";
3
4
  import { GetInteractionProtocolsQueryDto, GetInteractionQuoteQueryDto, GetInteractionTargetsQueryDto, } from "./interaction.model";
4
5
  import { InteractionService } from "./interaction.service";
@@ -8,6 +9,8 @@ export const InteractionController = new Elysia({
8
9
  detail: { tags: ["Interaction"], hide: true },
9
10
  })
10
11
  .get("/targets", async ({ query: { protocolId, chainId, identifier } }) => {
12
+ if (!isAddress(identifier))
13
+ return [];
11
14
  return await InteractionService.getTargets(chainId, protocolId, identifier);
12
15
  }, {
13
16
  query: GetInteractionTargetsQueryDto,
@@ -26,6 +29,8 @@ export const InteractionController = new Elysia({
26
29
  })
27
30
  // ─── Get Transaction ─────────────────────────────────────────────────
28
31
  .get("/transaction", async ({ query: { protocolId, chainId, identifier, userAddress, fromAmount, fromTokenAddress, slippage } }) => {
32
+ if (!isAddress(identifier))
33
+ return;
29
34
  const [target] = await InteractionService.getTargets(chainId, protocolId, identifier);
30
35
  //TODO: throw error
31
36
  if (!target)
@@ -545,6 +545,9 @@ export declare enum tacCampaigns {
545
545
  TAC_Supply_ylbfBTCtac = "TAC Supply ylbfBTC.tac 0x0d1862e73a1430A5FD3245B47859c1BEcD6f3A1D",
546
546
  TAC_Supply_uTAC = "TAC Supply uTAC++ 0xAF87B90E8a3035905697E07Bb813d2d59D2b0951"
547
547
  }
548
+ export declare enum HypurrFiCampaigns {
549
+ HypurrFi_Borrow_Pooled_USDXL = "HypurrFi Borrow Pooled USDXL 0xa0399Ff8F46Ce6C2Cfee05C5F67307C7F390a439"
550
+ }
548
551
  declare const AnglesInterfaceCampaigns: {
549
552
  "0x15E96CDecA34B9DE1B31586c1206206aDb92E69D": {
550
553
  campaignType: any;
@@ -621,6 +621,10 @@ export var tacCampaigns;
621
621
  tacCampaigns["TAC_Supply_ylbfBTCtac"] = "TAC Supply ylbfBTC.tac 0x0d1862e73a1430A5FD3245B47859c1BEcD6f3A1D";
622
622
  tacCampaigns["TAC_Supply_uTAC"] = "TAC Supply uTAC++ 0xAF87B90E8a3035905697E07Bb813d2d59D2b0951";
623
623
  })(tacCampaigns || (tacCampaigns = {}));
624
+ export var HypurrFiCampaigns;
625
+ (function (HypurrFiCampaigns) {
626
+ HypurrFiCampaigns["HypurrFi_Borrow_Pooled_USDXL"] = "HypurrFi Borrow Pooled USDXL 0xa0399Ff8F46Ce6C2Cfee05C5F67307C7F390a439";
627
+ })(HypurrFiCampaigns || (HypurrFiCampaigns = {}));
624
628
  const AnglesInterfaceCampaigns = {
625
629
  [anglesCampaigns.Angles_supply_in_angles_liquid]: {
626
630
  campaignType: Campaign.ERC20_FIX_APR,
@@ -6688,6 +6692,23 @@ const WorldChainInterfaceCampaigns = {
6688
6692
  },
6689
6693
  },
6690
6694
  };
6695
+ const HypurrFiInterfaceCampaigns = {
6696
+ [HypurrFiCampaigns.HypurrFi_Borrow_Pooled_USDXL]: {
6697
+ campaignType: Campaign.ERC20REBASEFIXAPR,
6698
+ computeChainId: ChainId.HYPEREVM,
6699
+ distributionChainId: ChainId.HYPEREVM,
6700
+ targetToken: "0xa0399Ff8F46Ce6C2Cfee05C5F67307C7F390a439",
6701
+ rewardToken: "0x05225a6416EDaeeC7227027E86F7A47D18A06b91",
6702
+ creator: "0xA9DdD91249DFdd450E81E1c56Ab60E1A62651701",
6703
+ hooks: [],
6704
+ whitelist: [],
6705
+ blacklist: [],
6706
+ forwarders: [],
6707
+ rewardTokenPricing: false,
6708
+ targetTokenPricing: false,
6709
+ apr: "365",
6710
+ },
6711
+ };
6691
6712
  export const MerklInterfaceCampaigns = {
6692
6713
  [program.Puffer]: PufferInterfaceCampaigns,
6693
6714
  [program.ZkSync]: ZkSyncInterfaceCampaigns,
@@ -116,6 +116,7 @@ export function decodeReturnValue(returnData, key, type) {
116
116
  case Erc20SubType.yei_lending:
117
117
  case Erc20SubType.xlend_lending:
118
118
  case Erc20SubType.xlend_borrowing:
119
+ case Erc20SubType.stability_lending:
119
120
  return AaveInterface.decodeFunctionResult("UNDERLYING_ASSET_ADDRESS", returnData)[0];
120
121
  case Erc20SubType.radiant_borrow:
121
122
  case Erc20SubType.radiant_lend:
@@ -155,6 +155,7 @@ export function createCall(target, key, type, metaData) {
155
155
  case Erc20SubType.aave_lending:
156
156
  case Erc20SubType.sake_lending:
157
157
  case Erc20SubType.sake_borrowing:
158
+ case Erc20SubType.stability_lending:
158
159
  case Erc20SubType.aave_borrowing:
159
160
  case Erc20SubType.ironclad_lending:
160
161
  case Erc20SubType.ironclad_borrowing:
@@ -89,6 +89,7 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
89
89
  case Erc20SubType.moonwell:
90
90
  case Erc20SubType.splice:
91
91
  case Erc20SubType.aave_lending:
92
+ case Erc20SubType.stability_lending:
92
93
  case Erc20SubType.vicuna_lending:
93
94
  case Erc20SubType.sake_lending:
94
95
  case Erc20SubType.yei_lending: