public static ExchangeBitcoinResponse FromJObject(JObject jObject) { var isSuccess = jObject["success"].ToObject <bool>(); var errors = jObject["errors"] == null ? null : jObject["errors"].Values <string>(); var tjo = jObject["transfer"]; var transferInfo = new TransferInfo( tjo.Value <string>("_type"), tjo.Value <string>("code"), tjo.Value <DateTime?>("created_at"), tjo["fees"] .Select(token => (JProperty)token) .Select(jProperty => new CoinbaseFee( jProperty.Name, new PriceUnit( jProperty.Value["cents"].Value <decimal>() * .01m, jProperty.Value["currency_iso"].Value <string>()))), tjo.Value <string>("status"), tjo.Value <DateTime?>("payout_date"), PriceUnit.FromJToken(tjo["btc"]), PriceUnit.FromJToken(tjo["subtotal"]), PriceUnit.FromJToken(tjo["total"]) ); return(new ExchangeBitcoinResponse(isSuccess, errors, transferInfo)); }
public TransferInfo(string type, string code, DateTime? createdAt, IEnumerable<CoinbaseFee> fees, string status, DateTime? payoutDate, PriceUnit bitcoinAmount, PriceUnit subtotal, PriceUnit total) { this.Type = type; this.Code = code; this.CreatedAt = createdAt; this.Fees = fees.ToArray(); this.Status = status; this.PayoutDate = payoutDate; this.BitcoinAmount = bitcoinAmount; this.Subtotal = subtotal; this.Total = total; }
public TransferInfo(string type, string code, DateTime?createdAt, IEnumerable <CoinbaseFee> fees, string status, DateTime?payoutDate, PriceUnit bitcoinAmount, PriceUnit subtotal, PriceUnit total) { this.Type = type; this.Code = code; this.CreatedAt = createdAt; this.Fees = fees.ToArray(); this.Status = status; this.PayoutDate = payoutDate; this.BitcoinAmount = bitcoinAmount; this.Subtotal = subtotal; this.Total = total; }
public PriceBuyResponse(PriceUnit subtotal, IEnumerable <CoinbaseFee> fees, PriceUnit totalAmount) { this.Subtotal = subtotal; this.Fees = fees.ToArray(); this.TotalAmount = totalAmount; }
public PriceBuyResponse(PriceUnit subtotal, IEnumerable<CoinbaseFee> fees, PriceUnit totalAmount) { this.Subtotal = subtotal; this.Fees = fees.ToArray(); this.TotalAmount = totalAmount; }