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

Problem with parameters, malformed request #46

Closed
jbrepogmailcom opened this issue Dec 9, 2021 · 4 comments
Closed

Problem with parameters, malformed request #46

jbrepogmailcom opened this issue Dec 9, 2021 · 4 comments

Comments

@jbrepogmailcom
Copy link

jbrepogmailcom commented Dec 9, 2021

Hello, some time ago you have sucessfuly resolved my problem with malformed request for order change - you hepled to set correct parameters syntax.

Now I want to POST order create, but I am getting Malformed request again. The syntax should be correct, I used it from previsous working order update. I think the problem can be displayPriceFactor and priceFactor, because NiceHash documentation is extremely vague. Can you help please?

python3 /home/janbenes/nicehash.py -b https://api2.nicehash.com -o <key> -k <key> -s <secret> -m POST -p "/main/api/v2/hashpower/order" -d '{"market":"EU","algorithm":"SHA256ASICBOOST","amount":"0.011","poolId":"ANTpool","type":"STANDARD","marketFactor":"1000000000000000.00000000","displayMarketFactor":"PH","limit":"0.1","price":"0.0053","displayPriceFactor":"BTC","priceFactor":"1"}'

Unexpected error: 400: Bad Request: b'{"error_id":"99037110-3632-4ec7-9ed5-02f6d90635d5","errors":[{"code":60,"message":"Malformed request"}]}'
@jbrepogmailcom
Copy link
Author

One problem solved, poolId is something else than pool name. Anyway, I have other problem:

Unexpected error: 400: Bad Request: b'{"error_id":"7a935461-903f-42c8-b1e6-3624fad75329","errors":[{"code":5068,"message":"Invalid order market factor"}]}'

"marketFactor":"1000000000000000.00000000"

That marketFactor works in order opdate...

@bl4z
Copy link
Collaborator

bl4z commented Dec 9, 2021

i think error could also refer to price factor that should be something like

displayMarketFactor: "TH"
displayPriceFactor: "TH"
limit: "0.00100000"
marketFactor: "1000000000000.00000000"
price: "0.11"
priceFactor: "1000000000000.00000000"

@jbrepogmailcom
Copy link
Author

jbrepogmailcom commented Dec 9, 2021

Unfortunately same error... (tried to change limit to 100 too..)

{"market":"EU","algorithm":"SHA256ASICBOOST","amount":"0.011","poolId":"125c3400-e602-4ae1-953c-402298533158","type":"STANDARD","marketFactor":"1000000000000.00000000","displayMarketFactor":"TH","limit":"0.1","price":"0.0053","displayPriceFactor":"BTC","priceFactor":"1000000000000.00000000"}'
Unexpected error: 400: Bad Request: b'{"error_id":"efa2ff7d-73e8-43bc-9007-320ae1cc2ad4","errors":[{"code":5068,"message":"Invalid order market factor"}]}'

@bl4z
Copy link
Collaborator

bl4z commented Dec 9, 2021

params should be something like that

{"type":"STANDARD","limit":"0.05","poolId":"17bb399a-3797-4fe0-915e-d0fdf41f24d8","price":"0.1","priceFactor":"1000000000000000.00000000","displayPriceFactor":"PH","marketFactor":"1000000000000000.00000000","displayMarketFactor":"PH","amount":"0.001","algorithm":"SHA256","market":"EU"}

see params for algos here: https://api2.nicehash.com/main/api/v2/mining/algorithms

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

2 participants