coinexcom / coinex_exchange_api Goto Github PK
View Code? Open in Web Editor NEWThe global digital coin exchange.
The global digital coin exchange.
我试过使用 :
{ "id": 0, "method": "kline.subscribe", "params": ["TRXETH", "CARDBTC", "CETETH", "EOSDACBCH",1] }
或者
{"method": "kline.subscribe","params": [["TRXETH",1],["CARDBTC",1],["CETETH",1],["EOSDACBCH",1]],"id": 0}
都是返回非法参数. 是我的请求方式有问题还是不支持订阅多个交易对K线?
"deal" does not seem to be documented
https://github.com/coinexcom/coinex_exchange_api/wiki/053state#market-status-api
https://github.com/coinexcom/coinex_exchange_api/wiki/062submit_withdraw
提交一个提币order。
其中参数:coin_address
描述:use ":" to put “address” and “payment_id”
payment_id那里来呢?
when i use "Cancel Order List" api, the api return me the follow error:
{'message': {'id': 'Missing required parameter in the query string', 'market': 'Missing required parameter in the query string'}}
but, the request had the 'id' and 'market' fields as bellow:
{'access_id': 'XXXXXXX', 'id': XXXXXX, 'market': 'EOSBCH', 'tonce': 1518058095349}
what is this error for ?? thanks.
On fast price movement the order book seems like goes out of sync.
Is there a code example (preferably c#) that shows how to maintain the order book?
Always getting error "tonce check error, correct tonce should be within one minute of the current time"
I checked your timestamp here https://api.coinex.com/v1/market/ticker?market=BTCBCH and my timestamp I send via tonce and it's the same
https://github.com/coinexcom/coinex_exchange_api/wiki/062submit_withdraw
Sometimes works, but often I get a "Invalid withdrawal address" error message when the withdrawal address is just fine (if works using the web GUI.
I sent ID verification on websocket.
but server sent no response and websocket immediately closed.
I wonder, how to determine the minimum quote amount for Market Buy Orders. I retrieve market informations from this URL: https://www.coinex.com/res/market/
It contains the "least_amount" (minimum asset amount) for each market, but not a "least_quote / least_price" amountwhich is important when placing a Market Buy Order.
By trail and error I could find out some minimum quote volumes. E.g:
Is there any API endpoint or web resource, that provides these information?
Thank you!
What is the ETA ?
Transaction and KLine request has no "since" parameter, it is not possible to request older data.
Requesting historical data is a very important, please add that as soon as possible.
Here is the code I'm using to make the request:
def _auth_request(self, url, params=None):
params['tonce'] = make_standard_nonce()
params['access_id'] = self.access_id
str_params = urlencode(sorted(params.items(), key=lambda x: x[0])) #alphabetize
to_sign = str_params + "&secret_key=%s" % self.api_secret
digest = hashlib.md5(to_sign).hexdigest().upper()
return self.get_url(url + str_params, headers={
'Content-Type': 'application/json',
'authorization': digest})
def get_exchange_balance(self, crypto):
url = "https://api.coinex.com/v1/balance/"
resp = self._auth_request(url, {}).json()
return resp
The url being hit is: https://api.coinex.com/v1/balance/access_id=CBC91...&tonce=1514650947531
and the signature is D7B19280DF3C4A1E25AAA461F83214DB
what could I be doing wrong?
IOC order is immediate-or-cancel order.
but when the place IOC orderd, sometimes remaining order.
Can you please implement an API call to get the deposit address for a given currency?
Not support mulit-markt in websocket subscription?
In the example of this page
https://github.com/coinexcom/coinex_exchange_api/wiki/012security_authorization
The following string is hashed by MD5 algorithm
access_id=4DA36FFC61334695A66F8D29020EB589&amount=1.0&market=BTCBCH&price=680&tonce=1513746038205&type=buy&secret_key=B51068CF10B34E7789C374AB932696A05E0A629BE7BFC62F
And the result is:
C6F0DDA352101C2258F992A277397F4A
but I have tried multiple times, my MD5 result is
610AB90A1D31D45901D173E4F59C9384
For example I hash the string in https://passwordsgenerator.net/md5-hash-generator/, http://onlinemd5.com/, both give 610AB90A1D31D45901D173E4F59C9384 but not C6F0DDA352101C2258F992A277397F4A
Is there any issue with your example?
why appear this error message?
"message": "tonce check error, correct tonce should be within one minute of the current time"
my post 'tonce': 1518009608459
I note down order details every time I place an order.
As of 29 June 2018, https://github.com/coinexcom/coinex_exchange_api/wiki/039user_deals documents in Return value description that id is order number. However, I cannot lookup order in my system with such id.
Please advise.
I've been able to use all websocket methods just fine, however I cant seem to get querying kline data to work.
I'm sending {"method":"kline.query","params":["BTCBCH",60],"id":2}
as per documentation, but I always get invalid argument
as an answer. I tried changing both the market string and the seconds parameter but no luck. Anyone knows what the problem is?
The current API makes you iterate over all possible markets to get all open orders. This can be quite inefficient if you have orders on many markets. v1/order/pending should make the market parameter optional and when it is not specified it should return all the pending orders.
$requestdata=array( 'market'=>'LOOMBCH', 'id'=>'934131734', ); echo $sell_respond=curlPost('order/pending',$apikey['A'],'get',$requestdata);
返回
{ "code": 0, "data": { "count": 1, "curr_page": 1, "data": [ { "amount": "10", "asset_fee": "0", "avg_price": "0.00", "create_time": 1531241329, "deal_amount": "0", "deal_fee": "0", "deal_money": "0", "fee_asset": null, "fee_discount": "0", "id": 934131734, "left": "10", "maker_fee_rate": "0.001", "market": "LOOMBCH", "order_type": "limit", "price": "0.00031497", "status": "not_deal", "taker_fee_rate": "0.001", "type": "sell" } ], "has_next": false }, "message": "Ok" }
access_id tonce参数每个请求都会用到,写到函数公共部分, 每次请求都头信息都签名了
但实际订单没有取消
Is it possible to place limit/market orders over websockets? So that when we send request we get an acceptance, and we get a message over the socket connection whenever the order status changes.
If not, is there any plan to incorporate this, and what would the ETA be like?
Still having error code 11,
"params": {...} ->
"params": [
"4DA36FFC61334695A66F8D29020EB589",
"C6F0DDA352101C2258F992A277397F4A", #sign data
1513746038205 #for milliseconds spent from Unix epoch to current time and error between tonce and server time can not exceed plus or minus 60s
], didn't help
trading_stream.call('server.sign', login_params).then(
()=>{ ... }
).catch((e)=>{
// getting here with e = {"code": 11}
});
Using the example in the WS API instruction the K line api is returning 'invalid argument'.
{"method":"kline.query","params":["BTCBCH",60],"id": 15}
Market Depth and Latest transaction don't seem to have any issue.
Good coinex
It seems the secret key is not transmitted alongside the message as an extra security layer, in case of breach of SSL. But by itself, authenticating the message with a plain MD5(message + key) is insecure, as explained in HMAC Wikipedia page. I recommend to deprecate such method for new keys, and use instead HMAC or maybe SHA-3, which can be used in place of MD5 in this case (SHA-3 doesn't suffer from the vulnerability).
It is also a hassle to have to reencode a JSON message in ordered GET format, it would be much easier if I could generate the authorization code directly from the JSON data sent.
Hi,
I'm just wondering that 0310 Mining difficulty is still working or not right now. I managed to invoke this api but always got a zero. Here is the response I got,
{
"code": 0,
"data": {
"difficulty": "0",
"prediction": "0",
"update_time": 1531829100
},
"message": "Ok"
}
I'm sure I have included the signature in the header. What else I am missing? Cheers.
websocket的各接口文档中,都有两种方式:acquire以及subscribe,请问两者有何区别?websocket不都是订阅(websocket.send())然后服务端主动推送信息(websocket.on('message', () => {}))吗?
#Request
{
"method":"depth.subscribe",
"params":[
"BTCBCH", # 交易对
5,
"0"
],
"id":15
}
#notify 没有告诉我是哪个交易对的深度信息
{
"method": "depth.update",
"params": [
false, #Boolean, true: for complete result,false: for update based on latest retrun result
{ #Update info
"bids": [ #Depth of Buy
[
"12.25", #Buy in price
"0.0588" #Buy in count
]
],
"asks": [ #Depth of Sell
[
"12.94", #Sell out price
"0.1524" #Sell out count
]
]
}
],
"id": null
}
When placing an IOC order through the API, if part of the deal is executed and part is canceled, the "status" field has a value of "cancel" even though the API documentation says it would be "part_deal":
"status": "done", # order status: cancel;done;part_deal;
when do you have withdraw coin api?
when i use your demo, get_account() appear error as follow:
"code": 227, "message": "tonce check error, correct tonce should be within one minute of the current time"
and the code print tonce is bellow:
my post 'tonce': 1518009608459
why appear this error message?
The last_id is ignored, only the last 1000 trade is returned.
Example call:
https://api.coinex.com/v1/market/deals?market=BTCUSDT&last_id=377867782
Please fix last_id and also add last_date parameter, which can request older data by date.
It's useful to receive updated BestBuyPrice and BestSellPrice (without parsing MarketDepth separately)
https://github.com/coinexcom/coinex_exchange_api/wiki/053state#subscribe-market-24h-status
Is there an endpoint to enable and disable "Use CET for trading fees"?
Help me to revoke this api changes
if i send limit_orders, most of them were success, but a few return me 'Signature error',
so what cause this happen?
How to subscribe multiple depth pairs? I want to subscribe BTC/USDT CET/USDT pairs, but when i sent twice , the previous one will be replaced.
{
"method":"depth.subscribe",
"params":[
"BTCUSDT", #1.market: See<API invocation description·market>
5, #2.limit: Count limit
"0" #3.interval: Merge,String
],
"id":15
}
I am placing order using api. And i am creating nonce like
Long tonce = new Date().getTime();
and i have also tired like
long unixTime = System.currentTimeMillis() / 1000L;
I am getting error code 227 with msg "tonce check error, correct tonce should be within one minute of the current time"
Please help!
I'm trying to get the single data value in the json balance, but as result it show error TypeError: string indices must be integers, not unicode
When sending POST requests (Orders, Withdrawal requests) am i supposed to be signing the whole request body?
POST https://api.coinex.com/v1/order/limit
{
"access_id":" BFFA64957AA240F6BBEA26F4E07EC0D9",
"amount": "56.5", # order count
"price": "10", # order price
"type": "sell", # order type
"market":"BTCBCH", # market type
"tonce": 1513746038205,
"source_id": "123" # user defines number and return
}
or just sign
{
"access_id":" BFFA64957AA240F6BBEA26F4E07EC0D9",
"tonce": 1513746038205,
}
I'm getting this response on all my POSTs trying both ways:
{
"code": 25,
"data": {}
"message": "Signature Error"
}
Any help is appreciated!
An example: I make a limit sell limit order, then i make a market buy order and buy coins from order which i opened earlier?
The before parameter seems to be ignored:
https://api.fcoin.com/v2/market/candles/M1/btcusdt?before=1&limit=20
only the latest 20 candle is returned.
In the API docs is stated "Request submission frequency: 5 times per second per IP (for Trading and Account API); no limit on Market API". But even after some seconds of inactivity, I get sometimes a HTTP 429 - "Too many requests" error.
Thanks for you advice.
It now always returns:
message '{"error": {"code": 11, "message": "IP:172.31.20.161 is not allowed"}, "result": null, "id": 115}'
Problem is that this is not my IP address, and it returns this error no matter where I try it from.
I have my IP address enabled on the API key I am using, so that is not the issue.
From the website, I am able to view the history of assets including their gifts here:
But there is no API for this.
Will this be available soon?
Websocket time has an additional 6 digits number at the end: 1496458040.059284
What "059284" would represent and how to interpret it?
I remember ViaBTC had the option to return all tickers with just 1 call like:
/api/v1/market/ticker/all
Is it possible to implement this call on Coinex too? Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.