Net.Cache.DynamoDb.ERC20 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Net.Cache.DynamoDb.ERC20 --version 2.0.0
                    
NuGet\Install-Package Net.Cache.DynamoDb.ERC20 -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Net.Cache.DynamoDb.ERC20" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net.Cache.DynamoDb.ERC20" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Net.Cache.DynamoDb.ERC20" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Net.Cache.DynamoDb.ERC20 --version 2.0.0
                    
#r "nuget: Net.Cache.DynamoDb.ERC20, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Net.Cache.DynamoDb.ERC20@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Net.Cache.DynamoDb.ERC20&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Net.Cache.DynamoDb.ERC20&version=2.0.0
                    
Install as a Cake Tool

Net.Cache.DynamoDb.ERC20

Overview

Net.Cache.DynamoDb.ERC20 is a specialized extension designed to facilitate the caching of ERC20 token information using Amazon DynamoDB. It integrates seamlessly with Ethereum blockchain networks to provide efficient access and management of ERC20 token details, such as token name, symbol, decimals, and total supply.

Features

  • ERC20 Token Information Caching: Efficiently caches ERC20 token information, reducing the need for repeated blockchain queries.
  • Automatic Key Generation: Generates unique hash keys for each token based on its chain ID and address, ensuring efficient data retrieval.
  • Flexible Initialization Options: Supports initialization with custom or default DynamoDB client and RPC service settings.
  • In-Memory Layer: Uses an in-memory cache alongside DynamoDB for faster repeated access.
  • Integration with Net.Cache.DynamoDb: Builds upon the robust caching capabilities of Net.Cache.DynamoDb, providing a specific solution for ERC20 tokens.

Getting Started

Installation

To get started with Net.Cache.DynamoDb.ERC20, ensure that you have Net.Cache.DynamoDb installed. Then, include Net.Cache.DynamoDb.ERC20 in your project

Usage

Initialize Erc20CacheService

You can initialize the Erc20CacheService using the default constructor or by passing custom implementations of IDynamoDbClient and IErc20ServiceFactory:

var cacheService = new Erc20CacheService();

Or with custom dependencies:

var context = new DynamoDBContext(customClient);
var dynamoDbClient = new DynamoDbClient(context);
var erc20ServiceFactory = new Erc20ServiceFactory();
var cacheService = new Erc20CacheService(dynamoDbClient, erc20ServiceFactory);
Caching ERC20 Token Information

To cache ERC20 token information, create a HashKey and use the GetOrAddAsync method of Erc20CacheService:

var chainId = 1L; // Ethereum mainnet
var contractAddress = new EthereumAddress("0x..."); // ERC20 token contract address
var hashKey = new HashKey(chainId, contractAddress);

var tokenInfo = await cacheService.GetOrAddAsync(
    hashKey,
    rpcUrlFactory: () => Task.FromResult("https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID"),
    multiCallFactory: () => Task.FromResult(new EthereumAddress("0x...multicall"))
);

Console.WriteLine($"Token Name: {tokenInfo.Name}, Symbol: {tokenInfo.Symbol}");

This method retrieves the token information from the cache if it exists, or fetches it from the blockchain and stores it in both the DynamoDB table and the in-memory cache otherwise.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Net.Cache.DynamoDb.ERC20:

Package Downloads
DownloaderV3.Source.CovalentDocument

The module for fetching, decoding, and saving blockchain event data using Covalent API in the DownloaderV3 system.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 601 9/25/2025
2.0.1 197 9/24/2025
2.0.0 254 8/8/2025
1.3.10 1,020 7/22/2025
1.3.9 486 7/21/2025
1.3.8 472 7/21/2025
1.3.7 228 7/16/2025
1.3.6 191 7/16/2025
1.3.5 2,043 8/20/2024
1.3.4 218 7/10/2024
1.3.3 356 6/17/2024
1.3.0 1,839 3/19/2024
1.2.2 1,654 2/9/2024
1.2.1 1,811 2/8/2024
1.2.0 227 2/7/2024