Skip to content
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

Feature/shared #1427

Merged
merged 60 commits into from
Sep 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a1df754
wip
JKorf Aug 9, 2024
e43b137
wip
JKorf Aug 9, 2024
c6d73c5
wip
JKorf Aug 11, 2024
7491ada
wip
JKorf Aug 12, 2024
2802ac5
wip
JKorf Aug 12, 2024
6a232bf
wip
JKorf Aug 13, 2024
6e50e67
Merge branch 'master' into feature/shared
JKorf Aug 13, 2024
e618f35
wip
JKorf Aug 14, 2024
9736be9
wip
JKorf Aug 14, 2024
a457a49
wip
JKorf Aug 15, 2024
4fa5c20
wip
JKorf Aug 15, 2024
63cef47
wip
JKorf Aug 16, 2024
aad8fe4
wip
JKorf Aug 18, 2024
a8df78f
Merge branch 'master' into feature/shared
JKorf Aug 19, 2024
b1d61dc
wip
JKorf Aug 20, 2024
b029a83
wip
JKorf Aug 22, 2024
83bb087
wip
JKorf Aug 25, 2024
a951021
wip
JKorf Aug 25, 2024
3c4c16a
wip
JKorf Aug 28, 2024
0f383e2
Merge branch 'master' into feature/shared
JKorf Aug 28, 2024
742a28c
wip
JKorf Sep 1, 2024
0c830d5
Merge branch 'master' into feature/shared
JKorf Sep 2, 2024
e854dc6
wip
JKorf Sep 2, 2024
2ab6cc2
wip
JKorf Sep 3, 2024
4a68b15
wip
JKorf Sep 4, 2024
b5b6c18
wip
JKorf Sep 4, 2024
db82414
wip
JKorf Sep 4, 2024
7bc3988
wip
JKorf Sep 5, 2024
e118bcf
wip
JKorf Sep 5, 2024
3d29b0a
wip
JKorf Sep 6, 2024
00d6757
wip
JKorf Sep 8, 2024
abb309e
wip
JKorf Sep 9, 2024
0de250b
wip
JKorf Sep 9, 2024
fe2f186
wip
JKorf Sep 9, 2024
69c46d2
wip
JKorf Sep 10, 2024
ea4b8af
wip
JKorf Sep 10, 2024
80395a0
wip
JKorf Sep 10, 2024
dc863df
Merge branch 'master' into feature/shared
JKorf Sep 11, 2024
d6a3d01
wip
JKorf Sep 11, 2024
dc0d830
wip
JKorf Sep 12, 2024
cf182e0
wip
JKorf Sep 12, 2024
b46a84c
wip
JKorf Sep 13, 2024
546541c
wip
JKorf Sep 15, 2024
59297ef
wip
JKorf Sep 17, 2024
b14f929
wip
JKorf Sep 18, 2024
d84b62f
wip
JKorf Sep 19, 2024
09c6f0e
wip
JKorf Sep 20, 2024
389e326
wip
JKorf Sep 22, 2024
241f052
wip
JKorf Sep 23, 2024
da9fd49
wip
JKorf Sep 23, 2024
777fcf7
wip
JKorf Sep 24, 2024
161c223
wip
JKorf Sep 25, 2024
a7c6f08
wip
JKorf Sep 25, 2024
c76d08d
Merge branch 'master' into feature/shared
JKorf Sep 25, 2024
f224519
wip
JKorf Sep 25, 2024
a5c7d59
wip
JKorf Sep 26, 2024
deff832
wip
JKorf Sep 26, 2024
1bf6910
wip
JKorf Sep 27, 2024
e7d086c
Update Binance.Net.csproj
JKorf Sep 27, 2024
f97b750
Update Binance.Net.csproj
JKorf Sep 27, 2024
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
Prev Previous commit
Next Next commit
wip
JKorf committed Sep 1, 2024
commit 742a28c3bfab07e3cbcd8ed675a06db51fd09d3f
Original file line number Diff line number Diff line change
@@ -77,7 +77,8 @@ protected override AuthenticationProvider CreateAuthenticationProvider(ApiCreden
/// <inheritdoc />
public override string FormatSymbol(string baseAsset, string quoteAsset, ApiType? futuresType = null)
{
return (baseAsset + quoteAsset).ToUpper(CultureInfo.InvariantCulture) + "_PERP";
var suffix = futuresType == null ? string.Empty : "_PERP";
return baseAsset.ToUpperInvariant() + quoteAsset.ToUpperInvariant() + suffix;
}

internal Uri GetUrl(string endpoint, string api, string? version = null)

Large diffs are not rendered by default.

100 changes: 64 additions & 36 deletions Binance.Net/Clients/SpotApi/BinanceRestClientSpotApiShared.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ internal partial class BinanceRestClientUsdFuturesApi : RestApiClient, IBinanceR
/// <inheritdoc />
public override string FormatSymbol(string baseAsset, string quoteAsset, ApiType? futuresType = null)
{
var suffix = futuresType == null ? string.Empty : "_PERP";
var suffix = futuresType == null ? string.Empty : "_PERP"; // _PERP Actually ever needed?
return baseAsset.ToUpperInvariant() + quoteAsset.ToUpperInvariant() + suffix;
}

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Binance.Net/ExtensionMethods/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Binance.Net.Clients;
using Binance.Net.Interfaces;
using Binance.Net.Interfaces.Clients;
using Binance.Net.Interfaces.Clients.SpotApi;
using Binance.Net.Objects.Options;
using Binance.Net.SymbolOrderBooks;
using CryptoExchange.Net.Clients;
using CryptoExchange.Net.SharedApis.Interfaces;
using System.Net;

namespace Microsoft.Extensions.DependencyInjection
@@ -61,6 +63,10 @@ public static IServiceCollection AddBinance(
services.AddTransient(x => x.GetRequiredService<IBinanceRestClient>().SpotApi.CommonSpotClient);
services.AddTransient(x => x.GetRequiredService<IBinanceRestClient>().UsdFuturesApi.CommonFuturesClient);
services.AddTransient(x => x.GetRequiredService<IBinanceRestClient>().CoinFuturesApi.CommonFuturesClient);

services.RegisterSharedRestInterfaces(x => x.GetRequiredService<IBinanceRestClient>().SpotApi.SharedClient);
services.RegisterSharedSocketInterfaces(x => x.GetRequiredService<IBinanceSocketClient>().SpotApi.SharedClient);

if (socketClientLifeTime == null)
services.AddSingleton<IBinanceSocketClient, BinanceSocketClient>();
else
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CryptoExchange.Net.SharedApis.Interfaces;
using CryptoExchange.Net.SharedApis.Interfaces.Rest;
using System;
using System.Collections.Generic;
using System.Text;
@@ -8,8 +9,16 @@ namespace Binance.Net.Interfaces.Clients.CoinFuturesApi
public interface IBinanceRestClientCoinFuturesApiShared :
ITickerRestClient,
IFuturesSymbolRestClient,
IFuturesOrderRestClient,
IKlineRestClient,
IRecentTradeRestClient
IRecentTradeRestClient,
ITradeHistoryRestClient,
ILeverageRestClient,
IPositionRestClient,
IMarkKlineRestClient,
IIndexKlineRestClient,
IOrderBookRestClient,
IOpenInterestRestClient
{
}
}
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
namespace Binance.Net.Interfaces.Clients.SpotApi
{
public interface IBinanceRestClientSpotApiShared:
IAssetRestClient,
IAssetsRestClient,
IBalanceRestClient,
IDepositRestClient,
IKlineRestClient,
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CryptoExchange.Net.SharedApis.Interfaces;
using CryptoExchange.Net.SharedApis.Interfaces.Rest;
using System;
using System.Collections.Generic;
using System.Text;
@@ -8,8 +9,16 @@ namespace Binance.Net.Interfaces.Clients.UsdFuturesApi
public interface IBinanceRestClientUsdFuturesApiShared :
ITickerRestClient,
IFuturesSymbolRestClient,
IFuturesOrderRestClient,
IKlineRestClient,
IRecentTradeRestClient
IRecentTradeRestClient,
ITradeHistoryRestClient,
ILeverageRestClient,
IPositionRestClient,
IMarkKlineRestClient,
IIndexKlineRestClient,
IOrderBookRestClient,
IOpenInterestRestClient
{
}
}