Net.Cache.DynamoDb.ERC20
1.2.0
See the version list below for details.
dotnet add package Net.Cache.DynamoDb.ERC20 --version 1.2.0
NuGet\Install-Package Net.Cache.DynamoDb.ERC20 -Version 1.2.0
<PackageReference Include="Net.Cache.DynamoDb.ERC20" Version="1.2.0" />
paket add Net.Cache.DynamoDb.ERC20 --version 1.2.0
#r "nuget: Net.Cache.DynamoDb.ERC20, 1.2.0"
// Install Net.Cache.DynamoDb.ERC20 as a Cake Addin #addin nuget:?package=Net.Cache.DynamoDb.ERC20&version=1.2.0 // Install Net.Cache.DynamoDb.ERC20 as a Cake Tool #tool nuget:?package=Net.Cache.DynamoDb.ERC20&version=1.2.0
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 settings.Update Total Supply
: Offers functionality to update the total supply of tokens in the cache dynamically.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 ERC20CacheProvider
You can initialize the ERC20CacheProvider
using the default constructor or by passing an instance of ERC20StorageProvider
for more customized settings.
var erc20CacheProvider = new ERC20CacheProvider();
Or with a custom storage provider:
var customContext = new DynamoDBContext(customClient);
var erc20StorageProvider = new ERC20StorageProvider(customContext);
var erc20CacheProvider = new ERC20CacheProvider(erc20StorageProvider);
Caching ERC20 Token Information
To cache ERC20 token information, create a GetCacheRequest
and use the GetOrAdd
method of ERC20CacheProvider
:
var chainId = BigInteger.Parse("1"); // Ethereum mainnet
var contractAddress = new EthereumAddress("0x..."); // ERC20 token contract address
var rpcUrl = "https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID";
var request = new GetCacheRequest(chainId, contractAddress, rpcUrl);
var tokenInfo = erc20CacheProvider.GetOrAdd(contractAddress, request);
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 adds it to the cache otherwise.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- Net.Cache.DynamoDb (>= 1.2.0)
- Net.Cryptography.SHA256 (>= 1.0.0)
- Net.Web3.EthereumWallet (>= 1.0.0)
- Nethereum.Web3 (>= 4.18.0)
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.
Initial release of `Net.Cache.DynamoDb.ERC20` package.
Full changes can found here: https://github.com/The-Poolz/Net.Cache/releases/tag/v1.2.0