Skip to content

fix: map testnet blockchain name for indexer API calls#13

Open
ben-kaufman wants to merge 1 commit intotetherto:mainfrom
ben-kaufman:fix/testnet-blockchain-name-mapping
Open

fix: map testnet blockchain name for indexer API calls#13
ben-kaufman wants to merge 1 commit intotetherto:mainfrom
ben-kaufman:fix/testnet-blockchain-name-mapping

Conversation

@ben-kaufman
Copy link

Problem

resolveWalletBalances() and resolveWalletTransactions() use NetworkType enum values directly as the blockchain field in indexer API requests. On mainnet this works, 'ethereum' is accepted. On Sepolia, the indexer expects 'sepolia', not 'ethereum'.

The API returns empty results with no error, so balances and transactions silently show as zero/empty.

No testnet blockchain name mapping exists anywhere in the codebase.

Fix

Add getIndexerBlockchainName() and fromIndexerBlockchainName() methods that map 'ethereum' <> 'sepolia' when the chain config indicates Sepolia (chain ID 11155111).

Applied to both resolveWalletBalances() and resolveWalletTransactions() request payloads. The reverse mapping in resolveWalletBalances() ensures response data is keyed with the internal NetworkType value ('ethereum') so downstream consumers are unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant