using System; using System.Collections.Generic; using Newtonsoft.Json; using Cysharp.Threading.Tasks; using MoralisUnity.Web3Api.Models; namespace MoralisUnity.Web3Api.Interfaces { /// /// Represents a collection of functions to interact with the API endpoints /// public interface IDefiApi { /// /// Get the liquidity reserves for a given pair address /// /// Liquidity pair address /// The chain to query /// To get the reserves at this block number /// Get the reserves to this date (any format that is accepted by momentjs) /// * Provide the param 'to_block' or 'to_date' /// * If 'to_date' and 'to_block' are provided, 'to_block' will be used. /// /// web3 provider url to user when using local dev chain /// Returns the pair reserves UniTask GetPairReserves (string pairAddress, ChainList chain, string toBlock=null, string toDate=null, string providerUrl=null); /// /// Fetches and returns pair data of the provided token0+token1 combination. /// The token0 and token1 options are interchangable (ie. there is no different outcome in "token0=WETH and token1=USDT" or "token0=USDT and token1=WETH") /// /// /// The factory name or address of the token exchange /// Token0 address /// Token1 address /// The chain to query /// To get the reserves at this block number /// Get the reserves to this date (any format that is accepted by momentjs) /// * Provide the param 'to_block' or 'to_date' /// * If 'to_date' and 'to_block' are provided, 'to_block' will be used. /// /// Returns the pair address of the two tokens UniTask GetPairAddress (string exchange, string token0Address, string token1Address, ChainList chain, string toBlock=null, string toDate=null); } }