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 #18

Merged
merged 52 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
c11508a
wip
JKorf Aug 9, 2024
372d648
wip
JKorf Aug 9, 2024
8222a91
wip
JKorf Aug 11, 2024
aaa7079
wip
JKorf Aug 12, 2024
2dd9362
wip
JKorf Aug 12, 2024
557ec52
wip
JKorf Aug 13, 2024
b9c3255
wip
JKorf Aug 14, 2024
1044027
wip
JKorf Aug 14, 2024
6fe8cc9
wip
JKorf Aug 15, 2024
181c5a2
wip
JKorf Aug 15, 2024
a8b1e8d
wip
JKorf Aug 16, 2024
a24b3ae
wip
JKorf Aug 18, 2024
8dc7fa3
Merge branch 'main' into feature/shared
JKorf Aug 19, 2024
64c19de
wip
JKorf Aug 19, 2024
6ddcff5
wip
JKorf Aug 20, 2024
2feab62
wip
JKorf Aug 22, 2024
ca7d721
wip
JKorf Aug 25, 2024
f644877
wip
JKorf Aug 28, 2024
1d339f5
Merge branch 'main' into feature/shared
JKorf Aug 28, 2024
d29c977
wip
JKorf Sep 1, 2024
ae67248
Merge branch 'main' into feature/shared
JKorf Sep 2, 2024
0cecdd3
wip
JKorf Sep 2, 2024
3034afd
wip
JKorf Sep 3, 2024
3d4e698
wip
JKorf Sep 4, 2024
8a9b08f
wip
JKorf Sep 4, 2024
6be3a2e
wip
JKorf Sep 5, 2024
63ff391
wip
JKorf Sep 5, 2024
835139d
wip
JKorf Sep 6, 2024
615460e
wip
JKorf Sep 8, 2024
49f2b22
wip
JKorf Sep 9, 2024
c56b4ed
wip
JKorf Sep 10, 2024
747dcaa
wip
JKorf Sep 10, 2024
4ac863e
wip
JKorf Sep 10, 2024
f9729e3
Merge branch 'main' into feature/shared
JKorf Sep 11, 2024
12b2442
wip
JKorf Sep 12, 2024
9ae7e03
wip
JKorf Sep 12, 2024
a687260
wip
JKorf Sep 13, 2024
374f4bf
wip
JKorf Sep 15, 2024
2a7767e
wip
JKorf Sep 17, 2024
7470a03
wip
JKorf Sep 18, 2024
154cee4
wip
JKorf Sep 19, 2024
54ecdbf
wip
JKorf Sep 20, 2024
c2c7f33
wip
JKorf Sep 22, 2024
0b79224
wip
JKorf Sep 23, 2024
77e967a
wip
JKorf Sep 23, 2024
0acd040
wip
JKorf Sep 24, 2024
489b1ca
wip
JKorf Sep 25, 2024
93525f9
wip
JKorf Sep 25, 2024
2f063fe
wip
JKorf Sep 25, 2024
99702f2
wip
JKorf Sep 26, 2024
5a43eb4
wip
JKorf Sep 27, 2024
30ebf82
Update BingX.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
2 changes: 1 addition & 1 deletion BingX.Net.UnitTests/Subscriptions/Spot/Ticker.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> { "id": "|1|", "reqType": "sub", "dataType": "BTC-USDT@ticker" }
< { "id": "|1|", "code": 0, "msg": "" }
=
{"code":0,"timestamp":1714641292823,"data":{"e":"24hTicker","E":1714641292821,"s":"BTC-USDT","p":458.94,"P":"0.80%","o":57341.78,"h":59464.03,"l":56633.32,"c":57800.72,"v":2012.11,"q":115994192.64,"O":1714554892821,"C":1714641292821,"A":57800.78,"a":1.62801,"B":57800.27,"b":1.59514}}
{"code":0,"timestamp":1727163468055,"dataType":"BTC-USDT@ticker","data":{"e":"24hTicker","E":1727163468053,"s":"ETH-USDT","p":-2.29,"P":"-0.09%","o":2644.56,"h":2702.79,"l":2609.68,"c":2642.27,"v":13865.37,"q":36747069.40,"O":1727077068053,"C":1727163468053,"A":2642.30,"a":21.552,"B":2642.23,"b":3.136416}}
4 changes: 2 additions & 2 deletions BingX.Net/BingX.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup Label="Deterministic Build" Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -52,6 +52,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="CryptoExchange.Net" Version="7.11.2" />
<PackageReference Include="CryptoExchange.Net" Version="8.0.0" />
</ItemGroup>
</Project>
163 changes: 150 additions & 13 deletions BingX.Net/BingX.Net.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
using BingX.Net.Objects.Internal;
using CryptoExchange.Net.Converters.MessageParsing;
using BingX.Net.Interfaces.Clients.PerpetualFuturesApi;
using BingX.Net.Interfaces.Clients.SpotApi;
using CryptoExchange.Net.SharedApis;

namespace BingX.Net.Clients.PerpetualFuturesApi
{
/// <inheritdoc cref="IBingXRestClientPerpetualFuturesApi" />
internal class BingXRestClientPerpetualFuturesApi : RestApiClient, IBingXRestClientPerpetualFuturesApi
internal partial class BingXRestClientPerpetualFuturesApi : RestApiClient, IBingXRestClientPerpetualFuturesApi
{
#region fields
internal static TimeSyncState _timeSyncState = new TimeSyncState("Perpetual Futures Api");
Expand Down Expand Up @@ -53,7 +55,8 @@ internal BingXRestClientPerpetualFuturesApi(ILogger logger, HttpClient? httpClie
#endregion

/// <inheritdoc />
public override string FormatSymbol(string baseAsset, string quoteAsset) => baseAsset.ToUpperInvariant() + "-" + quoteAsset.ToUpperInvariant();
public override string FormatSymbol(string baseAsset, string quoteAsset, TradingMode tradingMode, DateTime? deliverTime = null) => baseAsset.ToUpperInvariant() + "-" + quoteAsset.ToUpperInvariant();
public IBingXRestClientPerpetualFuturesApiShared SharedClient => this;

/// <inheritdoc />
protected override IMessageSerializer CreateSerializer() => new SystemTextJsonMessageSerializer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public async Task<WebCallResult<BingXFuturesTradingFees>> GetTradingFeesAsync(Ca
/// <inheritdoc />
public async Task<WebCallResult<string>> StartUserStreamAsync(CancellationToken ct = default)
{
if (_baseClient.AuthenticationProvider == null)
return new WebCallResult<string>(new NoApiCredentialsError());

var request = _definitions.GetOrCreate(HttpMethod.Post, "/openApi/user/auth/userDataStream", BingXExchange.RateLimiter.RestAccount1, 1, false,
limitGuard: new SingleLimitGuard(5, TimeSpan.FromSeconds(1), RateLimitWindowType.Sliding, keySelector: SingleLimitGuard.PerApiKey));
var result = await _baseClient.SendRawAsync<BingXListenKey>(request, null, ct).ConfigureAwait(false);
Expand All @@ -91,6 +94,9 @@ public async Task<WebCallResult<string>> StartUserStreamAsync(CancellationToken
/// <inheritdoc />
public async Task<WebCallResult> KeepAliveUserStreamAsync(string listenKey, CancellationToken ct = default)
{
if (_baseClient.AuthenticationProvider == null)
return new WebCallResult(new NoApiCredentialsError());

var parameters = new ParameterCollection
{
{ "listenKey", listenKey }
Expand All @@ -107,6 +113,9 @@ public async Task<WebCallResult> KeepAliveUserStreamAsync(string listenKey, Canc
/// <inheritdoc />
public async Task<WebCallResult> StopUserStreamAsync(string listenKey, CancellationToken ct = default)
{
if (_baseClient.AuthenticationProvider == null)
return new WebCallResult(new NoApiCredentialsError());

var parameters = new ParameterCollection
{
{ "listenKey", listenKey }
Expand Down
Loading
Loading