C# API sample broken
SajeewaD opened this issue · 5 comments
Is the C# api sample meant to be working? I'm getting the 2000 invalid session error that others have complained about but I'm using the published api class in the C# demo.
I'm also having trouble with the C# example implementation. I've pulled it down and have updated the settings to use my API key, secret, org ID etc, but I'm getting the same invalid session 2000 error code.
I've tried a few API keys/secrets with various levels of permissions (all permissions, and cut down to the bits I need for returning rig information from the rigs2 endpoint).
I can run the requests on the API docs successfully (I've noticed that clicking the "Fill logged-in user credentials" link uses a different API key to the ones I have in my API keys list - I assume this is for my direct user?).
I have also manually implemented the API and HMAC signature generation in .NET Core 3.1 using the HttpClient as opposed to RestSharp with no luck.
I have 2FA enabled on my account - could this be causing an issue? I haven't seen anything in the docs regarding 2FA.
Any advice would be greatly appreciated.
will look into it ....
Much appreciated - give me a shout if you need any more info from me.
hi .. i just run demo and it works just fine on test platform - please note coin names usually uses T prefix ie TBTC ... and therefor cannot be directly used on production. .. this is sample output
running HashPowerOrder
2021-08-18 10:32:36.5473|INFO|connect.Hpo|server time: "1629275572059"
2021-08-18 10:32:36.6443|INFO|connect.Hpo|algo settings: "X16R"
2021-08-18 10:32:36.7903|INFO|connect.Hpo|balance: 5,92794042 "TBTC"
2021-08-18 10:32:36.9303|INFO|connect.Hpo|new pool id: "4e18639e-745c-4e2d-b1f3-e009764db637"
2021-08-18 10:32:37.1544|INFO|connect.Hpo|new order id: "18f40460-cb8b-4ff9-8cdf-af9eda8fdaf9"
2021-08-18 10:32:37.2582|INFO|connect.Hpo|update order response: "{"error_id":"f287b0ac-06d2-4225-beeb-5d3eea9b96dd","errors":[{"code":2997,"message":"Invalid input: Price data can contain only up to 4 digits to the right of the decimal point!"}]}"
2021-08-18 10:32:37.3476|INFO|connect.Hpo|delete order response: "{"id":"18f40460-cb8b-4ff9-8cdf-af9eda8fdaf9","createdTs":"2021-08-18T08:32:52.698390Z","updatedTs":"2021-08-18T08:32:52.698390Z","requestId":"7ec308a5-cca9-4666-997f-6f499f6eea63","type":{"code":"STANDARD","description":"Standard"},"market":"EU","algorithm":{"algorithm":"X16R","title":"X16R","enabled":true,"order":33},"status":{"code":"PENDING_CANCELLATION","description":"Pending cancellation"},"price":"0.00100000","limit":"0.00100000","amount":"0.00100000","availableAmount":"0.00096030","payedAmount":"0.00000000","alive":false,"startTs":"2021-08-18T08:32:52.643576Z","endTs":"2021-08-28T08:32:52.643576Z","pool":{"id":"4e18639e-745c-4e2d-b1f3-e009764db637","name":"my pool fd46de48-f7cf-43ed-8491-f7065b60307f","algorithm":"X16R","stratumHostname":"pool.host.name","stratumPort":3456,"username":"pool_username","password":"x","inMoratorium":false},"organizationId":"194e3b63-8741-4bdc-8e28-c396b365993c","creatorUserId":"a6a0ce53-b02d-48ed-9e3d-88adc15df39f","rigsCount":0,"acceptedCurrentSpeed":"0.00000000","displayMarketFactor":"TH","marketFactor":"1000000000000.00000000","estimateDurationInSeconds":0,"liquidation":"OPEN"}"
2021-08-18 10:32:37.4214|INFO|connect.Hpo|update pool response: "{"success":true,"message":null}"
running Exchange
2021-08-18 10:32:37.4871|INFO|connect.Exch|server time: "1629275573110"
2021-08-18 10:32:37.5599|INFO|connect.Exch|exchange settings: "TLTC"
2021-08-18 10:32:37.6671|INFO|connect.Exch|balance: 5,92694042 "TBTC"
2021-08-18 10:32:37.7899|INFO|connect.Exch|cheapest offer price: 0,0025 supply: 18
2021-08-18 10:32:37.7899|INFO|connect.Exch|order url: "/exchange/api/v2/order?market=TLTCTBTC&side=buy&type=limit&quantity=0.20000000&price=0.00250000"
2021-08-18 10:32:38.0247|INFO|connect.Exch|order create: "{"orderId":"da6b0cf6-7e60-48cb-86c6-0e9aee168473","price":0.0025,"trigger_price":0,"origQty":0.2,"origSndQty":0.0005,"executedQty":0.2,"executedSndQty":0.0005,"type":"LIMIT","side":"BUY","submitTime":1629275573479124,"lastResponseTime":1629275573643794,"state":"FULL"}"
please contact NH support with error id if problem still exists
Thanks for looking into that.