@merkl/api 0.21.32 → 0.21.33

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.
Files changed (38) hide show
  1. package/dist/src/eden/index.d.ts +80 -0
  2. package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/factoryFinder.js +1 -1
  3. package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/curveProcessor.js +6 -2
  4. package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/processorMapping.js +1 -0
  5. package/dist/src/engine/deprecated/erc20SubTypeProcessors/tokenTypeToProtocolAndAction.js +4 -0
  6. package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/tvl.js +5 -1
  7. package/dist/src/engine/implementations/Erc20/subTypes/index.d.ts +2 -1
  8. package/dist/src/engine/implementations/Erc20/subTypes/index.js +1 -0
  9. package/dist/src/guards/BackOffice.guard.d.ts +1 -1
  10. package/dist/src/guards/BackOffice.guard.js +1 -1
  11. package/dist/src/guards/Engine.guard.d.ts +1 -1
  12. package/dist/src/guards/Engine.guard.js +2 -3
  13. package/dist/src/guards/VerifyJwt.guard.d.ts +10 -0
  14. package/dist/src/guards/VerifyJwt.guard.js +13 -0
  15. package/dist/src/index.d.ts +32 -0
  16. package/dist/src/index.js +2 -0
  17. package/dist/src/modules/v4/accounting/accounting.controller.js +7 -13
  18. package/dist/src/modules/v4/authentication/authentication.controller.d.ts +52 -0
  19. package/dist/src/modules/v4/authentication/authentication.controller.js +23 -0
  20. package/dist/src/modules/v4/authentication/authentication.model.d.ts +10 -0
  21. package/dist/src/modules/v4/authentication/authentication.model.js +6 -0
  22. package/dist/src/modules/v4/authentication/authentication.service.d.ts +10 -0
  23. package/dist/src/modules/v4/authentication/authentication.service.js +31 -0
  24. package/dist/src/modules/v4/blacklist/blacklist.controller.js +2 -2
  25. package/dist/src/modules/v4/cache/cache.repository.d.ts +3 -0
  26. package/dist/src/modules/v4/cache/cache.repository.js +9 -0
  27. package/dist/src/modules/v4/cache/cache.service.d.ts +3 -0
  28. package/dist/src/modules/v4/cache/cache.service.js +9 -0
  29. package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -3
  30. package/dist/src/modules/v4/reward/reward.controller.js +13 -4
  31. package/dist/src/modules/v4/router.d.ts +32 -0
  32. package/dist/src/modules/v4/router.js +3 -1
  33. package/dist/src/modules/v4/token/token.controller.js +1 -1
  34. package/dist/src/modules/v4/uniswap/uniswap.controller.js +1 -1
  35. package/dist/src/utils/decodeCalls.js +15 -5
  36. package/dist/src/utils/generateCardName.js +1 -0
  37. package/dist/tsconfig.package.tsbuildinfo +1 -1
  38. package/package.json +4 -3
@@ -94,7 +94,7 @@ export const TokenController = new Elysia({ prefix: "/tokens", detail: { tags: [
94
94
  body: CreateTokenDto,
95
95
  headers: AuthorizationHeadersDto,
96
96
  beforeHandle: async ({ headers, body }) => {
97
- await BackOfficeGuard({ headers });
97
+ BackOfficeGuard({ headers });
98
98
  body.address = throwOnInvalidRequiredAddress(body.address);
99
99
  throwOnUnsupportedChainId(body.chainId);
100
100
  },
@@ -91,7 +91,7 @@ export const UniswapController = new Elysia({
91
91
  params: ChainUniqueDto,
92
92
  headers: AuthorizationHeadersDto,
93
93
  beforeHandle: async ({ params, headers }) => {
94
- await BackOfficeGuard({ headers });
94
+ BackOfficeGuard({ headers });
95
95
  if (!UniV4ChainIdArray.includes(params.chainId))
96
96
  throw new UnsupportedNetwork(params.chainId);
97
97
  },
@@ -193,11 +193,21 @@ export function decodeReturnValue(returnData, key, type) {
193
193
  case "coin2":
194
194
  return CurveInterface.decodeFunctionResult("coins", returnData)[0];
195
195
  case "N_COINS":
196
- try {
197
- return CurveStableSwapNGInterface.decodeFunctionResult("N_COINS", returnData)[0];
198
- }
199
- catch (e) {
200
- return 2;
196
+ switch (type) {
197
+ case Erc20SubType.curveTricrypto:
198
+ try {
199
+ return CurveStableSwapNGInterface.decodeFunctionResult("N_COINS", returnData)[0];
200
+ }
201
+ catch (e) {
202
+ return 3;
203
+ }
204
+ default:
205
+ try {
206
+ return CurveStableSwapNGInterface.decodeFunctionResult("N_COINS", returnData)[0];
207
+ }
208
+ catch (e) {
209
+ return 2;
210
+ }
201
211
  }
202
212
  case "balances":
203
213
  return CurveStableSwapNGInterface.decodeFunctionResult("balances", returnData)[0];
@@ -160,6 +160,7 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
160
160
  }
161
161
  return `${typeInfo.name}`;
162
162
  case Erc20SubType.curveNPool:
163
+ case Erc20SubType.curveTricrypto:
163
164
  return `Curve ${typeInfo.name}`;
164
165
  case Erc20SubType.vicuna: {
165
166
  const parsedName = typeInfo.name.split(" ");