GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - arslanaybars/etherscan.dotnet.client: .NET client library for interacting with the EtherScan API

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
EtherScan.Dotnet.sln
EtherScan.Dotnet.sln
 
 
README.md
README.md
 
 

Repository files navigation

EtherScan .NET Client

NuGet

A comprehensive .NET client library for interacting with the EtherScan API.

For detailed endpoint information, see the official EtherScan V2 API Documentation.

Contents

  • Installation
  • Features
  • Quick Start
  • Usage Examples
  • Supported Chains
  • API Reference
  • Error Handling
  • Contributing
  • License

Installation

dotnet add package EtherScan.Dotnet.Client

Features

  • Full coverage of EtherScan API endpoints
  • Strongly typed request/response models
  • Async/await support
  • Comprehensive error handling
  • Multi-chain support
  • Built-in rate limiting handling
  • Automatic Wei to Ether conversion

Quick Start

using EtherScan.Dotnet.Client;
using EtherScan.Dotnet.Client.Models.Account.Request;
using EtherScan.Dotnet.Client.Models.Enumerations;

var client = new EtherScanClient("YOUR_API_KEY", ChainNetwork.EthereumMainnet, new HttpClient());

// Get account balance
var balance = await client.GetAccountBalanceAsync(new AccountBalanceRequest 
{ 
    Address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" 
});

Console.WriteLine($"Balance: {balance.Result?.BalanceInEther} ETH");

Usage Examples

Account Module

// Get multiple account balances
var balances = await client.GetMultipleAccountBalanceAsync(
    new AccountBalanceRequest 
    { 
        Address = "0x742d...44e,0xdac1...ec7" 
    });

// Get transactions
var txs = await client.GetTransactionsByAddressAsync(new TransactionRequest
{
    Address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
    StartBlock = 0,
    EndBlock = 99999999,
    Sort = "desc"
});

Contract Module

// Get contract ABI
var abi = await client.GetContractAbiAsync(new ContractAbiRequest 
{ 
    Address = "0xdac17f958d2ee523a2206206994597c13d831ec7" 
});

// Get contract source code
var source = await client.GetContractSourceCodeAsync(new ContractSourceCodeRequest 
{ 
    Address = "0xdac17f958d2ee523a2206206994597c13d831ec7" 
});

Supported Chains

  • Ethereum Mainnet
  • Sepolia Testnet
  • Holesky Testnet
  • BNB Chain
  • Polygon
  • Arbitrum
  • Optimism
  • Avalanche
  • Full list of supported networks

API Reference

See IEtherScanClient.cs for complete API documentation.

Error Handling

The client provides detailed error information through the Response class:

public class Response<T>
{
    public string Status { get; set; }
    public bool IsSuccess => Status == "1" && Message == "OK";
    public string Message { get; set; }
    public T? Result { get; set; }
}

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

.NET client library for interacting with the EtherScan API

Resources

Readme
Activity

Stars

11 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.