In Koindex, you can use APIs for mining and controlling this mining task.
1. Start mining
2. Stop mining
3. My mining detail
Start mining
When a user trades on Koindex, all commissions paid will be converted to XEX (Mining Coin) and returned to the user, so we can start mining by the “place order” api.
POST/v1/api/placeOrder
URL:
https://api.koindex.io/POST/v1/api/placeOrder
This api contains massed parameters required for normal transaction and the specific field of mining. show the “place a new order” detail→
example for normal transaction:
{
“api_key”:”****”,
“auth_nonce”:” 1524165420000”,
“auth_sign”:” 0aeb680bb3152c14f849037af45f9eb1”,
“pair”:” ETH_USDT”,
“isbid”:” true”,
“order_type”:” LIMIT”,
“price”:” 0.07455600”,
“amount”:” 1”,
“stop_price”:” 0”,
}
example for mining:
{
“api_key”:”****”,
“auth_nonce”:” 1524165420000”,
“auth_sign”:” 0aeb680bb3152c14f849037af45f9eb1”,
“pair”:” ETH_USDT”,
“isbid”:” true”,
“order_type”:” LIMIT”,
“price”:” 0.07455600”,
“amount”:” 1”,
“stop_price”:” 0”,
“pool":"1”,
}
Stop mining
Before the order has been filled, you can cancel the order by ‘cancel order’ api, when the transaction is cancelled, the mining will be stopped.
POST/v1/api/cancelOrder
URL:
https://api.koindex.io/POST/v1/api/cancelOrder?api_key=****&auth_nonce=1524165420000&auth_sign=0aeb680bb3152c14f849037af45f9eb1&pair=ETH_USDT&order_id=441346014116890624
Mining detail
If you want to check your mining situation such as your output amount, you can use this api to query.
GET/v1/api/mineLimit
URL:
https://api.koindex.io/GET/v1/api/mineLimit?api_key=****&auth_nonce=1524165420000&auth_sign=0aeb680bb3152c14f849037af45f9eb1
Request field:
api_key |
Your API key | String |
auth_nonce |
Timestamp | String |
auth_sign |
MD5coding. MD5(api_key+auth_nonce+apiSecret) | String |
Response:
{
"code": 0,
"data": {
"mined": "0",
"canmine": "100.00000000",
"limit": "100.00000000",
"manualmined": "0",
"manualDayLimit": "100.000000"
},
"channel": "mine"
}
code | response status, 0 is success, other is fail. |
data |
|
channel | auth-wallet | mine |