-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIErc20CacheService.cs
More file actions
32 lines (30 loc) · 1.74 KB
/
IErc20CacheService.cs
File metadata and controls
32 lines (30 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using Nethereum.Web3;
using System.Threading.Tasks;
using Net.Web3.EthereumWallet;
using Net.Cache.DynamoDb.ERC20.DynamoDb.Models;
namespace Net.Cache.DynamoDb.ERC20
{
/// <summary>
/// Provides caching operations for ERC20 token metadata backed by DynamoDB.
/// </summary>
public interface IErc20CacheService
{
/// <summary>
/// Retrieves a cached ERC20 token entry or adds a new one when it is missing.
/// </summary>
/// <param name="hashKey">The composite key of chain identifier and token address.</param>
/// <param name="rpcUrlFactory">Factory used to resolve the RPC endpoint URL.</param>
/// <param name="multiCallFactory">Factory used to resolve the address of the multicall contract.</param>
/// <returns>The cached or newly created <see cref="Erc20TokenDynamoDbEntry"/> instance.</returns>
public Task<Erc20TokenDynamoDbEntry> GetOrAddAsync(HashKey hashKey, Func<Task<string>> rpcUrlFactory, Func<Task<EthereumAddress>> multiCallFactory);
/// <summary>
/// Retrieves a cached ERC20 token entry or adds a new one when it is missing using a Web3 factory.
/// </summary>
/// <param name="hashKey">The composite key of chain identifier and token address.</param>
/// <param name="web3Factory">Factory used to resolve the Web3 client instance.</param>
/// <param name="multiCallFactory">Factory used to resolve the address of the multicall contract.</param>
/// <returns>The cached or newly created <see cref="Erc20TokenDynamoDbEntry"/> instance.</returns>
public Task<Erc20TokenDynamoDbEntry> GetOrAddAsync(HashKey hashKey, Func<Task<IWeb3>> web3Factory, Func<Task<EthereumAddress>> multiCallFactory);
}
}