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

Add agent endpoints #1450

Merged
merged 4 commits into from
Dec 10, 2024
Merged

Add agent endpoints #1450

merged 4 commits into from
Dec 10, 2024

Conversation

Alex1911-Jiang
Copy link
Contributor

No description provided.

@Alex1911-Jiang Alex1911-Jiang changed the title add agent endpoints Add agent endpoints Dec 5, 2024
@Alex1911-Jiang
Copy link
Contributor Author

@Alex1911-Jiang
Copy link
Contributor Author

Sorry, I only added the endpoints that I need to use.

brokerId.ValidateNotNull(nameof(brokerId));

var parameters = new ParameterCollection();
parameters.AddOptional("brokerId", brokerId.ToString(CultureInfo.InvariantCulture));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be parameters.Add("brokerId", brokerId);
It's not optional and it's already a string


var parameters = new ParameterCollection();
parameters.AddOptional("brokerId", brokerId.ToString(CultureInfo.InvariantCulture));
parameters.AddOptional("type", (int)IfNewUserMarginedFuturesType.Coin_margined_Futures);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use parameters.AddEnum("type", IfNewUserMarginedFuturesType.Coin_margined_Futures); instead


#region If New User

public async Task<WebCallResult<BinanceIfNewUser>> IfNewUser(string apiAgentCode, int? receiveWindow = null, CancellationToken ct = default)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments

/// Processing
/// </summary>
[Map("1")]
USDT_margined_Futures = 1,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CamelCasing please, so UsdtMarginedFutures

namespace Binance.Net.Interfaces.Clients.UsdFuturesApi
{
/// <summary>
/// Binance USD-M futures account endpoints, query user data.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect comment

namespace Binance.Net.Interfaces.Clients.CoinFuturesApi
{
/// <summary>
/// Binance Coin futures account endpoints, query user data.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect comment

/// If new user
/// </summary>
[JsonPropertyName("ifNewUser")]
public bool ifNewUser { get; set; } = false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IfNewUser, also default values not needed for bool values as the default is already false

/// If new user
/// </summary>
[JsonPropertyName("ifNewUser")]
public bool ifNewUser { get; set; } = false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other model

@JKorf
Copy link
Owner

JKorf commented Dec 5, 2024

Please have a look at the comments

@Alex1911-Jiang
Copy link
Contributor Author

I made some modifications, but "rate limiter" doesn't seem to be in the documentation, except for weight.

brokerId.ValidateNotNull(nameof(brokerId));

var parameters = new ParameterCollection();
parameters.AddOptional("brokerId", brokerId);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed the ToString, but it still should be parameters.Add instead of parameters.AddOptional

brokerId.ValidateNotNull(nameof(brokerId));

var parameters = new ParameterCollection();
parameters.AddOptional("brokerId", brokerId.ToString(CultureInfo.InvariantCulture));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, you also still have the ToString here

@JKorf
Copy link
Owner

JKorf commented Dec 9, 2024

I made some modifications, but "rate limiter" doesn't seem to be in the documentation, except for weight.

I see, it's not really clear what the limits are so I guess this is good enough.

2 more small comments.

@Alex1911-Jiang
Copy link
Contributor Author

Done!

@JKorf JKorf merged commit 99b26c4 into JKorf:master Dec 10, 2024
1 check passed
@Alex1911-Jiang Alex1911-Jiang deleted the apiAgen-endpoints branch December 10, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants