From 8663f921fc6bd73c88d965e6f851f08983c3b006 Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Mon, 10 Feb 2025 17:08:51 +0530 Subject: [PATCH] add hedera --- .env.example | 1 + src/config.ts | 35 ++++++++++++++++++++++++++++++++++- src/prices/coinGecko.ts | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 26db4482..7163e84c 100644 --- a/.env.example +++ b/.env.example @@ -45,6 +45,7 @@ DD_ENV=development #LUKSO_TESTNET_RPC_URL #METIS_ANDROMEDA_RPC_URL #GNOSIS_RPC_URL +#HEDERA_RPC_URL #COINGECKO_API_KEY= #IPFS_GATEWAYs=[] diff --git a/src/config.ts b/src/config.ts index 82917fe2..cb5d28da 100644 --- a/src/config.ts +++ b/src/config.ts @@ -19,7 +19,8 @@ type CoingeckoSupportedChainId = | 1329 | 42 | 42220 - | 1088; + | 1088 + | 295; const CHAIN_DATA_VERSION = "87"; const IPFS_DATA_VERSION = "1"; @@ -1828,6 +1829,38 @@ const CHAINS: Chain[] = [ }, ], }, + { + id: 295, + name: "hedera", + rpc: rpcUrl + .default("https://mainnet.hashio.io/api") + .parse(process.env.HEDERA_RPC_URL), + pricesFromTimestamp: Date.UTC(2025, 1, 1, 0, 0, 0), + tokens: [ + { + code: "HBAR", + address: "0x0000000000000000000000000000000000000000", + decimals: 8, + priceSource: { + chainId: 295, + address: "0x0000000000000000000000000000000000000000", + }, + }, + ], + subscriptions: [ + // Allo V2 + { + contractName: "AlloV2/Registry/V1", + address: "0x4aacca72145e1df2aec137e1f3c5e3d75db8b5f3", + fromBlock: 75239000, + }, + { + contractName: "AlloV2/Allo/V1", + address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1", + fromBlock: 75239000, + }, + ], + }, ]; export const getDecimalsForToken = ( diff --git a/src/prices/coinGecko.ts b/src/prices/coinGecko.ts index 8448008c..1d8f3428 100644 --- a/src/prices/coinGecko.ts +++ b/src/prices/coinGecko.ts @@ -31,6 +31,7 @@ const nativeTokens: { [key: number]: string } = { 42220: "celo", 1088: "metis-token", 100: "xdai", + 295: "hedera-hashgraph", }; type TimestampInMs = number;