using System; using System.Text; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; using Newtonsoft.Json; namespace MoralisUnity.Web3Api.Models { [DataContract] public class Trade { /// /// The transaction hash /// example: 0x057Ec652A4F150f7FF94f089A38008f49a0DF88e /// [DataMember(Name = "transaction_hash", EmitDefaultValue = false)] [JsonProperty(PropertyName = "transaction_hash")] public string TransactionHash { get; set; } /// /// The transaction index /// [DataMember(Name = "transaction_index", EmitDefaultValue = false)] [JsonProperty(PropertyName = "transaction_index")] public string TransactionIndex { get; set; } /// /// The token id(s) traded /// [DataMember(Name = "token_ids", EmitDefaultValue = false)] [JsonProperty(PropertyName = "token_ids")] public List TokenIds { get; set; } /// /// The address that sold the NFT /// example: 0x057Ec652A4F150f7FF94f089A38008f49a0DF88e /// [DataMember(Name = "seller_address", EmitDefaultValue = false)] [JsonProperty(PropertyName = "seller_address")] public string SellerAddress { get; set; } /// /// The address that bought the NFT /// example: 0x057Ec652A4F150f7FF94f089A38008f49a0DF88e /// [DataMember(Name = "buyer_address", EmitDefaultValue = false)] [JsonProperty(PropertyName = "buyer_address")] public string BuyerAddress { get; set; } /// /// The address of the contract that traded the NFT /// example: 0x057Ec652A4F150f7FF94f089A38008f49a0DF88e /// [DataMember(Name = "marketplace_address", EmitDefaultValue = false)] [JsonProperty(PropertyName = "marketplace_address")] public string MarketplaceAddress { get; set; } /// /// The value that was sent in the transaction (ETH/BNB/etc..) /// example: 1000000000000000 /// [DataMember(Name = "price", EmitDefaultValue = false)] [JsonProperty(PropertyName = "price")] public string Price { get; set; } /// /// The block timestamp /// example: 6/4/2021 4:00:15 PM /// [DataMember(Name = "block_timestamp", EmitDefaultValue = false)] [JsonProperty(PropertyName = "block_timestamp")] public string BlockTimestamp { get; set; } /// /// The blocknumber of the transaction /// example: 13680123 /// [DataMember(Name = "block_number", EmitDefaultValue = false)] [JsonProperty(PropertyName = "block_number")] public string BlockNumber { get; set; } /// /// The block hash /// example: 0x4a7c916ca4a970358b9df90051008f729685ff05e9724a9dddba32630c37cb96 /// [DataMember(Name = "block_hash", EmitDefaultValue = false)] [JsonProperty(PropertyName = "block_hash")] public string BlockHash { get; set; } /// /// Get the string presentation of the object /// /// String presentation of the object public override string ToString() { var sb = new StringBuilder(); sb.Append("class Trade{"); sb.Append(" TransactionHash ").Append(TransactionHash).Append("\n"); sb.Append(" TransactionIndex ").Append(TransactionIndex).Append("\n"); sb.Append(" TokenIds ").Append(TokenIds).Append("\n"); sb.Append(" SellerAddress ").Append(SellerAddress).Append("\n"); sb.Append(" BuyerAddress ").Append(BuyerAddress).Append("\n"); sb.Append(" MarketplaceAddress ").Append(MarketplaceAddress).Append("\n"); sb.Append(" Price ").Append(Price).Append("\n"); sb.Append(" BlockTimestamp ").Append(BlockTimestamp).Append("\n"); sb.Append(" BlockNumber ").Append(BlockNumber).Append("\n"); sb.Append(" BlockHash ").Append(BlockHash).Append("\n"); sb.Append("}"); return sb.ToString(); } /// /// Get the JSON string presentation of the object /// /// JSON string presentation of the object public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } } }