From 44b5616f9a2fc157809c3ca616cdcfa3d50ef712 Mon Sep 17 00:00:00 2001 From: Karan Pargal Date: Thu, 16 May 2024 18:58:26 +0530 Subject: [PATCH] feat: Shift constants to decoder --- .../decoder/protocols/connext/connext.decoders.ts | 13 ++++++++++++- .../protocols/connext/constants/domain-mapping.ts | 11 ----------- 2 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 services/decoder/protocols/connext/constants/domain-mapping.ts diff --git a/services/decoder/protocols/connext/connext.decoders.ts b/services/decoder/protocols/connext/connext.decoders.ts index adc7311..4bb8f19 100644 --- a/services/decoder/protocols/connext/connext.decoders.ts +++ b/services/decoder/protocols/connext/connext.decoders.ts @@ -8,10 +8,21 @@ import { import { decodeEventLog, type Abi } from "viem"; import ROUTER_ABI from "./abis/connext-router.abi.json"; import CALLER_ABI from "./abis/connext-call.abi.json"; -import { DOMAIN_ID_TO_CHAIN_ID } from "./constants/domain-mapping"; import { timestampParser } from "../../../../utils/functions"; import { prettifyCurrency } from "@covalenthq/client-sdk"; +const DOMAIN_ID_TO_CHAIN_ID: { [domain_id: number]: string } = { + 6648936: "Ethereum Mainnet", + 1886350457: "Polygon", + 1869640809: "Optimism", + 1634886255: "Arbitrum One", + 6778479: "Gnosis Chain", + 6450786: "BNB Chain", + 1818848877: "Linea", + 1835365481: "Metis", + 1650553709: "Base", +}; + GoldRushDecoder.on( "connext:RouterLiquidityAdded", ["eth-mainnet"], diff --git a/services/decoder/protocols/connext/constants/domain-mapping.ts b/services/decoder/protocols/connext/constants/domain-mapping.ts deleted file mode 100644 index 1496eeb..0000000 --- a/services/decoder/protocols/connext/constants/domain-mapping.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const DOMAIN_ID_TO_CHAIN_ID: { [domain_id: number]: string } = { - 6648936: "Ethereum Mainnet", - 1886350457: "Polygon", - 1869640809: "Optimism", - 1634886255: "Arbitrum One", - 6778479: "Gnosis Chain", - 6450786: "BNB Chain", - 1818848877: "Linea", - 1835365481: "Metis", - 1650553709: "Base", -};