Skip to main content

Nethereum.DataServices

Client library for accessing external blockchain data services — Etherscan REST APIs, Sourcify contract verification, 4Byte signature lookups, and chain metadata.

Installation

dotnet add package Nethereum.DataServices

Supported Services

ServiceDescription
EtherscanContract ABI retrieval, verified source code, transaction history
SourcifyDecentralised contract verification and metadata
4ByteFunction and event signature directory lookups
ChainListChain metadata, RPC endpoints, and network information

Key Components

ABI Retrieval

Fetch verified contract ABIs from multiple sources with automatic fallback:

using Nethereum.DataServices;

// ABIInfoStorage provides a composite pattern:
// cache → Sourcify → Etherscan → 4Byte
var abiStorage = ABIInfoStorageFactory.CreateDefault(cache);
var abi = await abiStorage.GetABIAsync(contractAddress, chainId);

Factory Methods

MethodSources
CreateDefault(cache)Cache → Sourcify → Etherscan → 4Byte
CreateWithSourcifyOnly(cache)Cache → Sourcify
CreateWithEtherscanOnly(cache)Cache → Etherscan
CreateLocalOnly(cache)Cache only
CreateCustom(...)Custom provider chain

Dependencies

  • Nethereum.ABI
  • Nethereum.EVM
  • Nethereum.Util.Rest