Skip to content

BL3P: move supporting classes to ExchangeBL3PAPI class #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ExchangeSharp/API/Exchanges/BL3P/ExchangeBL3PAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ExchangeSharp.API.Exchanges.BL3P;
using ExchangeSharp.API.Exchanges.BL3P.Models;
using ExchangeSharp.BL3P;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

// ReSharper disable once CheckNamespace
namespace ExchangeSharp
{
// ReSharper disable once InconsistentNaming
public sealed class ExchangeBL3PAPI : ExchangeAPI
public sealed partial class ExchangeBL3PAPI : ExchangeAPI
{
public override string BaseUrl { get; set; } = "https://api.bl3p.eu/";

Expand Down
33 changes: 18 additions & 15 deletions ExchangeSharp/API/Exchanges/BL3P/Models/BL3POrder.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
using Newtonsoft.Json;

namespace ExchangeSharp.API.Exchanges.BL3P.Models
namespace ExchangeSharp
{
// ReSharper disable once InconsistentNaming
public class BL3POrder
public sealed partial class ExchangeBL3PAPI : ExchangeAPI
{
[JsonProperty("price_int")]
[JsonConverter(typeof(FixedIntDecimalConverter), 5)]
public decimal Price { get; set; }
// ReSharper disable once InconsistentNaming
class BL3POrder
{
[JsonProperty("price_int")]
[JsonConverter(typeof(FixedIntDecimalConverter), 5)]
public decimal Price { get; set; }


[JsonProperty("amount_int")]
[JsonConverter(typeof(FixedIntDecimalConverter), 8)]
public decimal Amount { get; set; }
[JsonProperty("amount_int")]
[JsonConverter(typeof(FixedIntDecimalConverter), 8)]
public decimal Amount { get; set; }

public ExchangeOrderPrice ToExchangeOrder()
{
return new ExchangeOrderPrice
public ExchangeOrderPrice ToExchangeOrder()
{
Amount = Amount,
Price = Price
};
return new ExchangeOrderPrice
{
Amount = Amount,
Price = Price
};
}
}
}
}
21 changes: 12 additions & 9 deletions ExchangeSharp/API/Exchanges/BL3P/Models/BL3POrderBook.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
using Newtonsoft.Json;

namespace ExchangeSharp.API.Exchanges.BL3P.Models
namespace ExchangeSharp
{
// ReSharper disable once InconsistentNaming
public class BL3POrderBook
public sealed partial class ExchangeBL3PAPI : ExchangeAPI
{
[JsonProperty("marketplace")]
public string MarketSymbol { get; set; }
// ReSharper disable once InconsistentNaming
class BL3POrderBook
{
[JsonProperty("marketplace")]
public string MarketSymbol { get; set; }

[JsonProperty("asks")]
public BL3POrder[] Asks { get; set; }
[JsonProperty("asks")]
public BL3POrder[] Asks { get; set; }

[JsonProperty("bids")]
public BL3POrder[] Bids { get; set; }
[JsonProperty("bids")]
public BL3POrder[] Bids { get; set; }
}
}
}
2 changes: 1 addition & 1 deletion ExchangeSharp/API/Exchanges/BL3P/MultiWebsocketWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace ExchangeSharp.API.Exchanges.BL3P
namespace ExchangeSharp.BL3P
{
internal sealed class MultiWebsocketWrapper : IWebSocket
{
Expand Down