-
-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bb4f1b
commit 3cf0d13
Showing
16 changed files
with
418 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Binance.Net/Clients/CoinFuturesApi/BinanceRestClientCoinFuturesApiAgent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Binance.Net.Enums; | ||
using Binance.Net.Interfaces.Clients.CoinFuturesApi; | ||
using Binance.Net.Objects.Models.Futures; | ||
|
||
namespace Binance.Net.Clients.CoinFuturesApi | ||
{ | ||
/// <inheritdoc /> | ||
internal class BinanceRestClientCoinFuturesApiAgent : IBinanceRestClientCoinFuturesApiAgent | ||
{ | ||
private static readonly RequestDefinitionCache _definitions = new RequestDefinitionCache(); | ||
|
||
private readonly BinanceRestClientCoinFuturesApi _baseClient; | ||
|
||
internal BinanceRestClientCoinFuturesApiAgent(BinanceRestClientCoinFuturesApi baseClient) | ||
{ | ||
_baseClient = baseClient; | ||
} | ||
|
||
#region If New User | ||
|
||
public async Task<WebCallResult<BinanceIfNewUser>> IfNewUser(string brokerId, int? receiveWindow = null, CancellationToken ct = default) | ||
{ | ||
brokerId.ValidateNotNull(nameof(brokerId)); | ||
|
||
var parameters = new ParameterCollection(); | ||
parameters.AddOptional("brokerId", brokerId.ToString(CultureInfo.InvariantCulture)); | ||
parameters.AddOptional("type", (int)IfNewUserMarginedFuturesType.Coin_margined_Futures); | ||
parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)); | ||
|
||
var request = _definitions.GetOrCreate(HttpMethod.Get, "fapi/v1/apiReferral/ifNewUser", BinanceExchange.RateLimiter.SpotRestIp, 100, true); | ||
return await _baseClient.SendAsync<BinanceIfNewUser>(request, parameters, ct).ConfigureAwait(false); | ||
} | ||
|
||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Binance.Net/Clients/SpotApi/BinanceRestClientSpotApiAgent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Binance.Net.Interfaces.Clients.SpotApi; | ||
using Binance.Net.Objects.Models.Spot; | ||
|
||
namespace Binance.Net.Clients.SpotApi | ||
{ | ||
/// <inheritdoc /> | ||
internal class BinanceRestClientSpotApiAgent : IBinanceRestClientSpotApiAgent | ||
{ | ||
private static readonly RequestDefinitionCache _definitions = new RequestDefinitionCache(); | ||
|
||
private readonly BinanceRestClientSpotApi _baseClient; | ||
|
||
internal BinanceRestClientSpotApiAgent(BinanceRestClientSpotApi baseClient) | ||
{ | ||
_baseClient = baseClient; | ||
} | ||
|
||
#region If New User | ||
|
||
public async Task<WebCallResult<BinanceIfNewUser>> IfNewUser(string apiAgentCode, int? receiveWindow = null, CancellationToken ct = default) | ||
{ | ||
apiAgentCode.ValidateNotNull(nameof(apiAgentCode)); | ||
|
||
var parameters = new ParameterCollection(); | ||
parameters.AddOptional("apiAgentCode", apiAgentCode.ToString(CultureInfo.InvariantCulture)); | ||
parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? _baseClient.ClientOptions.ReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)); | ||
|
||
var request = _definitions.GetOrCreate(HttpMethod.Get, "sapi/v1/apiReferral/ifNewUser", BinanceExchange.RateLimiter.SpotRestIp, 100, true); | ||
return await _baseClient.SendAsync<BinanceIfNewUser>(request, parameters, ct).ConfigureAwait(false); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.