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 INativeApi { /// /// Gets the contents of a block by block hash /// /// The block hash or block number /// The chain to query /// The subdomain of the moralis server to use (Only use when selecting local devchain as chain) /// Returns the contents of a block UniTask GetBlock (string blockNumberOrHash, ChainList chain, string subdomain=null); /// /// Gets the closest block of the provided date /// /// Unix date in miliseconds or a datestring (any format that is accepted by momentjs) /// The chain to query /// web3 provider url to user when using local dev chain /// Returns the blocknumber and corresponding date and timestamp UniTask GetDateToBlock (string date, ChainList chain, string providerUrl=null); /// /// Gets the logs from an address /// /// address /// The chain to query /// The subdomain of the moralis server to use (Only use when selecting local devchain as chain) /// The block number /// * Provide the param 'block_numer' or ('from_block' and / or 'to_block') /// * If 'block_numer' is provided in conbinaison with 'from_block' and / or 'to_block', 'block_number' will will be used /// /// The minimum block number from where to get the logs /// * Provide the param 'block_numer' or ('from_block' and / or 'to_block') /// * If 'block_numer' is provided in conbinaison with 'from_block' and / or 'to_block', 'block_number' will will be used /// /// The maximum block number from where to get the logs /// * Provide the param 'block_numer' or ('from_block' and / or 'to_block') /// * If 'block_numer' is provided in conbinaison with 'from_block' and / or 'to_block', 'block_number' will will be used /// /// The date from where to get the logs (any format that is accepted by momentjs) /// * Provide the param 'from_block' or 'from_date' /// * If 'from_date' and 'from_block' are provided, 'from_block' will be used. /// * If 'from_date' and the block params are provided, the block params will be used. Please refer to the blocks params sections (block_number,from_block and to_block) on how to use them /// /// Get the logs 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. /// * If 'to_date' and the block params are provided, the block params will be used. Please refer to the blocks params sections (block_number,from_block and to_block) on how to use them /// /// topic0 /// topic1 /// topic2 /// topic3 /// Returns the logs of an address UniTask GetLogsByAddress (string address, ChainList chain, string cursor = "", string subdomain=null, string blockNumber=null, string fromBlock=null, string toBlock=null, string fromDate=null, string toDate=null, string topic0=null, string topic1=null, string topic2=null, string topic3=null, int? limit=null); /// /// Gets NFT transfers by block number or block hash /// /// The block hash or block number /// The chain to query /// cursor /// The subdomain of the moralis server to use (Only use when selecting local devchain as chain) /// limit /// Returns the contents of a block UniTask GetNFTTransfersByBlock (string blockNumberOrHash, ChainList chain, string cursor="", string subdomain=null, int? limit=null); /// /// Gets the contents of a block transaction by hash /// /// The transaction hash /// The chain to query /// The subdomain of the moralis server to use (Only use when selecting local devchain as chain) /// Returns the contents of a block transaction UniTask GetTransaction (string transactionHash, ChainList chain, string subdomain=null); /// /// Gets events in descending order based on block number /// /// address /// The topic of the event /// ABI of the specific event /// The chain to query /// cursor /// The subdomain of the moralis server to use (Only use when selecting local devchain as chain) /// web3 provider url to user when using local dev chain /// The minimum block number from where to get the logs /// * Provide the param 'from_block' or 'from_date' /// * If 'from_date' and 'from_block' are provided, 'from_block' will be used. /// /// The maximum block number from where to get the logs. /// * Provide the param 'to_block' or 'to_date' /// * If 'to_date' and 'to_block' are provided, 'to_block' will be used. /// /// The date from where to get the logs (any format that is accepted by momentjs) /// * Provide the param 'from_block' or 'from_date' /// * If 'from_date' and 'from_block' are provided, 'from_block' will be used. /// /// Get the logs 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. /// /// limit /// Returns a collection of events by topic UniTask> GetContractEvents (string address, string topic, object abi, ChainList chain, string cursor="", string subdomain=null, string providerUrl=null, int? fromBlock=null, int? toBlock=null, string fromDate=null, string toDate=null, int? limit=null); /// /// Runs a given function of a contract abi and returns readonly data /// /// address /// function_name /// Body /// The chain to query /// The subdomain of the moralis server to use (Only use when selecting local devchain as chain) /// web3 provider url to user when using local dev chain /// Returns response of the function executed UniTask RunContractFunction (string address, string functionName, RunContractDto abi, ChainList chain, string subdomain=null, string providerUrl=null); } }