burakoner / OKEx.Net

Open source .Net API wrapper for the @OKEx V5 Rest API and V5 Websocket API
MIT License
86 stars 49 forks source link

trouble with Account Endpoints (Signed) #32

Closed ali7sa closed 2 years ago

ali7sa commented 3 years ago

in Account Endpoints, we have 19 accounts. all of them are true except numbers 4 and 5. why? 4 and 5 return false but other return true.

burakoner commented 3 years ago

Can you explain please? which endpoint? what are the meanings of those numbers?

burakoner commented 3 years ago

I think you are talking about examples on readme file. I've fixed it in v5.0.5 both https://github.com/burakoner/OKEx.Net/commit/638c68a00cb53a3f49472b27cb90c4aaf624463a and https://www.nuget.org/packages/OKEx.Net/5.0.5

ali7sa commented 3 years ago

tnx a lot. It's ok now. but could you plz tell me how to use this method? you can see my problem in this link. this is an image --> https://ibb.co/H2H2R8b which attribute should I use for reporting? for example something like as xlsx or CSV or something like that. there are lots of methods. it's complicated. is there any manual or paper sheet or guide? thanks in advanced

burakoner commented 3 years ago

It returns WebCallResult<IEnumerable> data type. So you have an IEnumerable object in "account_04.Data" in your picture. You can use it as a list or array. Try to loop with for or foreach as below

var html = "<table>";
html +="<tr>";
html +="<td>Currency</td>";
html +="<td>Time </td>";
html +="<td>Instrument</td>";
html +="<td>InstrumentType</td>";
html +="<td>MarginMode</td>";
html +="<td>BillId </td>";
html +="<td>OrderId</td>";
html +="<td>Balance </td>";
html +="<td>BalanceChange </td>";
html +="<td>Quantity</td>";
html +="<td>Fee</td>";
html +="<td>FromAccount</td>";
html +="<td>ToAccount </td>";
html +="<td>Notes </td>";
html +="</tr>";
foreach(var bill in account_04.Data){
// Your action
// bill is a OkexAccountBill object. (https://github.com/burakoner/OKEx.Net/blob/a1cd2dbc1b51b9c9aca3ac47052d608e9260161a/Okex.Net/RestObjects/Account/OkexAccountBill.cs)

html +="<tr>";
html +="<td>"+bill.Currency+"</td>";
html +="<td>"+bill.Time +"</td>";
...
html +="</tr>";
}
html +="</table>";

I hope this sample will help you.

Notes: I didnt try it I've just written it here. Please fix if there is syntax error.

ali7sa commented 3 years ago

yes in the readme file. tnx a lot. but really I couldn't find as you saw that image. there is not exist. I don't know how to use . for and foreach didn't work cuz account_04.Data returns zero, and could contain the loop. could you plz sample code that how can I use this method. whatever you know is simple that I understand

burakoner commented 3 years ago

If you dont know where to go I cant help you. You need to check is there is rows in data as below.

if(account_04.Data.Count()>0)

ali7sa commented 2 years ago

is there any software that works the same as this code? finally, I couldn't understand code and couldn't use it!