From 78bcf3091a9eb0ee34c8563076a90638c278f434 Mon Sep 17 00:00:00 2001 From: Rohit Date: Fri, 30 Jan 2026 11:03:39 +0530 Subject: [PATCH] Revert "feat: address resolution function for hbarevm" --- modules/sdk-coin-evm/src/lib/utils.ts | 44 --------------------------- 1 file changed, 44 deletions(-) diff --git a/modules/sdk-coin-evm/src/lib/utils.ts b/modules/sdk-coin-evm/src/lib/utils.ts index 0fcebe7b85..ff934e9861 100644 --- a/modules/sdk-coin-evm/src/lib/utils.ts +++ b/modules/sdk-coin-evm/src/lib/utils.ts @@ -272,47 +272,3 @@ export function validateHederaAccountId(address: string): { valid: boolean; erro error: null, }; } - -/** - * Convert Hedera Account ID (e.g., 0.0.12345) to EVM address - */ -export async function resolveHederaAccountIdToEvmAddress( - accountId: string, - isProd: boolean -): Promise<{ address: string | null; error?: string }> { - try { - const mirrorNodeUrl = isProd - ? 'https://mainnet-public.mirrornode.hedera.com' - : 'https://testnet.mirrornode.hedera.com'; - - const response = await fetch(`${mirrorNodeUrl}/api/v1/accounts/${accountId}`); - - if (!response.ok) { - if (response.status === 404) { - return { - address: null, - error: 'Hedera Account ID not found. Please verify the account exists.', - }; - } - return { - address: null, - error: `Failed to resolve Hedera Account ID: ${response.status}`, - }; - } - - const accountData = (await response.json()) as { evm_address?: string }; - if (!accountData.evm_address) { - return { - address: null, - error: 'This Hedera account does not have an associated EVM address.', - }; - } - - return { address: accountData.evm_address }; - } catch (error) { - return { - address: null, - error: 'Failed to resolve Hedera Account ID. Please check your connection.', - }; - } -}