/// <summary> /// Allows you to retrieve information about items requested/sent in a given trade from BitSkins. /// Trade details will be unretrievable 7 days after the initiation of the trade. /// </summary> /// <param name="tradeToken">The trade token in the Steam trade's message.</param> /// <param name="tradeId">The trade ID in the Steam trade's message.</param> /// <returns>Details of this trade.</returns> public static TradeDetails GetTradeDetails(string tradeToken, string tradeId) { CheckParameters(tradeToken, tradeId); string urlRequest = GetUrlRequest(tradeToken, tradeId); string result = Server.ServerRequest.RequestServer(urlRequest); TradeDetails tradeDetails = ReadTradeDetails(result); return(tradeDetails); }
private static TradeDetails ReadTradeDetails(string result) { dynamic responseServerD = JsonConvert.DeserializeObject(result); dynamic createdAtD = responseServerD.data.created_at; dynamic itemsSentD = responseServerD.data.items_sent; dynamic itemsRetrievedD = responseServerD.data.items_retrieved; DateTime?createdAt = null; if (createdAtD != null) { createdAt = DateTimeExtension.FromUnixTime((long)createdAtD); } List <SentItem> sentItems = ReadSentItems(itemsSentD); List <RetrievedItem> retrievedItems = ReadRetrievedItems(itemsRetrievedD); TradeDetails tradeDetails = new TradeDetails(sentItems, retrievedItems, createdAt); return(tradeDetails); }