GithubHelp home page GithubHelp logo

coinex_exchange_api's Introduction

coinex_exchange_api

The global digital coin exchange.

You can access our online documentation by visiting the following website address: coinex_api_doc.

If you have any questions or concerns while browsing the documentation, please do not hesitate to contact our support team for further assistance.

coinex_exchange_api's People

Contributors

dakang496 avatar liangshilin avatar liuzuowei avatar luogang0 avatar pualxiao avatar xuwei0455 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coinex_exchange_api's Issues

Question about the MD5 hash of signature string in request header

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?

Minimum quote amount for Market Buy Orders

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:

  • CET/USDT : 0.1 USDT
  • BCH/USDT: 0.01 USDT
  • BTC/USDT: 10 USDT

Is there any API endpoint or web resource, that provides these information?

Thank you!

Can I make a deal with myself?

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?

WebSocket trade API ID not working

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.

ID verification is no response, error code 11

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

strange websocket time

Websocket time has an additional 6 digits number at the end: 1496458040.059284
What "059284" would represent and how to interpret it?

API MD5 authentication is insecure.

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.

POST signature errors

When sending POST requests (Orders, Withdrawal requests) am i supposed to be signing the whole request body?

Request

POST https://api.coinex.com/v1/order/limit

Request.Body

{
"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!

There needs to be a way to query all open orders

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.

Place orders over websockets

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?

How to create Tonce for placing order in java

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!

取消订单问题

$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参数每个请求都会用到,写到函数公共部分, 每次请求都头信息都签名了

但实际订单没有取消

I get a 404 when trying to get my exchange balance through the API

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?

Request submission frequency

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.

  1. Has this limit been changed due to trade-driven mining?
  2. Is the limit really per IP and not per Account? I've tried using different IPs (round robin) and even get the 429 error, when the last private API call came from another IP and was placed seconds ago.

Thanks for you advice.

Ticker returning all pairs?

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.

How to subscribe multiple depth pairs via websocket?

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
}

Mining difficulty returns 0

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.

k line ws api is returning message: 'invalid argument'

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.

IOC Order status is incorrect on part_deal

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;

订阅多个交易对k线

我试过使用 :
{ "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线?

Websocket kline query returns 'Invalid parameter'

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?

market depth goes out of sync

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?

cancel order return "Missing required parameter in the query string" errormsg

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}

关于websocket API的两个问题

  1. websocket的各接口文档中,都有两种方式:acquire以及subscribe,请问两者有何区别?websocket不都是订阅(websocket.send())然后服务端主动推送信息(websocket.on('message', () => {}))吗?

  2. 获取深度的websocket API((https://github.com/coinexcom/coinex_exchange_api/wiki/044depth#subscribe-market-depth)[https://github.com/coinexcom/coinex_exchange_api/wiki/044depth#subscribe-market-depth]),订阅消息中有交易对信息(BTCBCH),但服务器推送的消息中没有告诉我是那个交易对,我怎么区别返回的是哪个交易对的深度消息?

#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
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.