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

Get Balances Linq select SourceObject Type #186

Closed
NinjaRaiden opened this issue Feb 8, 2023 · 3 comments
Closed

Get Balances Linq select SourceObject Type #186

NinjaRaiden opened this issue Feb 8, 2023 · 3 comments

Comments

@NinjaRaiden
Copy link

Hello, I can not use linq to filter and select balances where SourceObject.Type = Trade or Main.

var x = kucoinClient.SpotApi.CommonSpotClient.GetBalancesAsync().Result;
            x.Data.Where(m => m.SourceObject.Type == ?)
@Torabi-srh
Copy link
Contributor

check the SourceObject Type its {Kucoin.Net.Objects.Models.Spot.KucoinAccount} in Spot API i think you doing it wrong.

@NinjaRaiden
Copy link
Author

check the SourceObject Type its {Kucoin.Net.Objects.Models.Spot.KucoinAccount} in Spot API i think you doing it wrong.

Yes you can check the SourceObject Type with Casting.
but you can't filter Where condition with SourceObject cause it need to casting first.

in order to achieve that:

KucoinAccount l =  (KucoinAccount) b.SourceObject;
switch (l.Type)
{
    case AccountType.Trade:{}break;
    .
    .
    .
}

@JKorf
Copy link
Owner

JKorf commented Nov 13, 2024

Closing due to cleaning up old issues
The CommonSpotClient has been deprecated in favor of the SharedClient implementation, which should be better usable

@JKorf JKorf closed this as completed Nov 13, 2024
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

No branches or pull requests

3 participants