-
-
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
b707d46
commit 99b26c4
Showing
16 changed files
with
423 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
39 changes: 39 additions & 0 deletions
39
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,39 @@ | ||
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 | ||
{ | ||
{ "brokerId", brokerId } | ||
}; | ||
parameters.AddEnum("type", IfNewUserMarginedFuturesType.CoinMarginedFutures); | ||
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
36 changes: 36 additions & 0 deletions
36
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,36 @@ | ||
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 | ||
{ | ||
{ "apiAgentCode", apiAgentCode } | ||
}; | ||
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.