Giter Club home page Giter Club logo

idex-api-docs's Introduction

IDEX API

API Documentation

Our API docs have moved. Please visit https://docs.idex.market/ for the latest documentation.

Sample Code

Sample code, written in JavaScript, can be found here.

Issues and Bugs

If you find a bug in the API please create an issue on Github, or contact our support team on Discord.

idex-api-docs's People

Contributors

0xkiwi avatar alexhustler avatar bradennapier avatar fubar avatar jsterling8 avatar jurosh avatar raypulver 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

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

idex-api-docs's Issues

Example of Trade method

Thanks for the api docs, could you please provide example on how to get nonce and v,r,s values. Thanks!

const salted = hashPersonalMessage(toBuffer(raw))
const {
v,
r,
s
} = mapValues(ecsign(salted, privateKeyBuffer), (value, key) => key === 'v' ? value : bufferToHex(value));
// send v, r, s values in payload

Entire orderbook

As per documentation, if market parameter omitted the entire orderbook returned by market key. When I omit I get error "Must specify a market". So any way to get whole orderbook? Or fix documentation.

lowestAsk and highestBid

lowestAsk and highestBid from ticker return not current lowest ask and highest bid as in most of all exchanges but seems like lowest and highest for 24 hr. Is it correct behaviour? It is more useful to have current values.

Invalid payload

Hello

Please help me with the issue
I am getting

{
  "error": "Invalid payload"
}

There are my request body

{ 
  "tokenBuy": "0x4ceda7906a5ed2179785cd3a40a69ee8bc99c466",
  "amountBuy": 28472604495,
  "tokenSell": "0x0000000000000000000000000000000000000000",
  "amountSell": 546722000000000012,
  "address": "0xA2939E0a6D7a01685a69F6CbBAF403807a1D2cb8",
  "nonce": 7797260479,
  "v": 28,
  "r": "0x10c08159e23a2a2787ae7eb416d003f708255777e0f32f9080f9b92a3bfcb804",
  "s": "0x384a696af073c00d0c0049944de113ef7f6e4ac0bb4ee4fc9b0f09d4a05eae73"
}

Error: Invalid payload (HTTP status code: 400)

Dear all devs,

When I place an order, sometimes successfully, sometimes failed with error:
Invalid payload (HTTP status code: 400)

Could you please give me an idea to fix this issue?

Thanks and best regards,
Nam Le

Missing cancels while listening WS for pushCancel and pushCancels

I'm using v2 WS API for orderbook syncing. I've stored each cancel from pushCancel and pushCancels messages using their ID as key in DB. But as i see, sometimes cancel is missed. For example, after cancel { "id": 38795396, ... } next is { "id": 38795398, ... } , but 38795397 is missed. I have tried to listen WS api parallel on 2 different machines, and both of them has same missed cancels.

Invalid Order Signature

I send this object to your API
{ method: 'POST',
url: 'https://api.idex.market/order',
json:
{ tokenBuy: '0xCdCFc0f66c522Fd086A1b725ea3c0Eeb9F9e8814',
amountBuy: '800000000000000000000',
tokenSell: '0x0000000000000000000000000000000000000000',
amountSell: '150000000000000000',
address: '0x8aFa6c139bf20a67B0fb716Df2113A41B13DF575',
nonce: 3,
expires: 1542202760165,
v: 27,
r: '0xbca1ee19d47d78bed7be14ae0484208065f7b227bd361d8eebabbfdd089a8c31',
s: '0x1b9bc8b5cb0d152cd93c13586ddea82e27452e5a08e4b91951d4e405a4577132' } }

This is Server Answer
{ error: 'Invalid order signature. Please try again.' }

Some orders from the same program sends succesful

{ method: 'POST',
url: 'https://api.idex.market/order',
json:
{ tokenBuy: '0x0D8775F648430679A709E98d2b0Cb6250d2887EF',
amountBuy: '348600000000000000000',
tokenSell: '0x0000000000000000000000000000000000000000',
amountSell: '150000000000000000',
address: '0x8aFa6c139bf20a67B0fb716Df2113A41B13DF575',
nonce: 1,
expires: 1542201756302,
v: 28,
r: '0x7c14b1e553acd6fe5504aed96603796c92de2d07c1cec8dacf387e7550066f89',
s: '0x5ab390de65ed3daddba213f83f497f83d18e0f632d2b2b70dbb83c704a6a9e99' } }
IT is answer:
{ orderNumber: 176110836,
orderHash: '0xb377a2a76de60b888ee8849842e77b5674a8c90f1c5d52447ecefe50424e54ee',
timestamp: 1542201761,
price: '0.000430292598967298',
amount: '348.6',
total: '0.15',
type: 'buy',
params:
{ tokenBuy: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
buyPrecision: 18,
amountBuy: '348600000000000000000',
tokenSell: '0x0000000000000000000000000000000000000000',
sellPrecision: 18,
amountSell: '150000000000000000',
expires: 1542201756302,
nonce: 1,
user: '0x8afa6c139bf20a67b0fb716df2113a41b13df575' } }

Whats wrong I do? Sing code is from your example

returnOrderBook

This API call is returning an empty dictionary, is it just me?

Trade request error

Send "trade" request
Get error:
{
"error": "ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') FOR UPDATE' at line 1"
}
http://picplus.ru/img/1807/21/db76d06f.png
or sometimes
{
"error": "Due to maintenance, this action has been temporarily disabled, try again soon"
}
http://picplus.ru/img/1807/21/97834087.png

Even if I send all post data. I get same error
http://picplus.ru/img/1807/21/15ef20d4.png

Accomodate error code along with error string in api

Hi,

While using the 'trade' api many times the order is not fulfilled as the order for which it was signed is no longer valid or is partially filled and the returns 400 status code.
As the string may change I don't want to rely upon it can we have error code to sent in the apis too as a improvement?

Example response:

{
    "error": "The order you are trying to match has been partially or fully matched. Please refresh to clear it from the orderbook."
}
and
{
    "error": "Order no longer available."
}

returnTicker not working as expected

Hello, returnTicker endpoint is returning {lowestAsk: "N/A", highestBid: "N/A"} for all currencies.

In this image you can see that we get N/A for ELEC
image

And it's like that for all currencies:
image

Check order is sucees

I am integrating IDEX API into one of our clients. We are implemented related API's but I've some questions

  1. How can I check order executed or not any event is there.

  2. How can I listen to only one currency pair instead of all pair's? (Very important, because we want to do trade for only one currency, this will save resources)

  3. What is the difference between trade and order API, can you explain in detail with an example.

  4. Can you please provide ropsten / rinkeby test IDEX implementation, this will save real ethers.

--
Thanks:
Jitendra Kumar

Next nonce error

When I tried to use endpoint returnNextNonce, I got an error {"result":"error","errors":["[LAMBDA-RUNNER]\n FAILED TO INITIALIZE LAMBDA! \n \n Our initialization function expects either one or two arguments, however, \n you provided 3 parameters.","Cannot set property 'agent' of undefined"]}.
A few days ago all was working.
Use API https://api.idex.market

Invalid order signature

I've tested my algorithm by example you've given at #26. The result is perfect match to your r, s, v values. However the error "Invalid order signature" still appears (not always but sometimes). As well as "Invalid cancel signature"

Random nonce broke my account

Due to not working API returnNextNonce method, i decided to use a very big random nonce. Then i finally placed order with an API, but now i even can't trade or withdraw on the site, cuz i changed nonce manually. Now when im tryna withdraw funds or place an order, a "nonce too low" error appears in a little window on site. API withdrawal doesnt work too says either nonce too low or Invalid signature. Thus, my funds r blocked, i cant do anything with my money!!! So when will u fix next nonce method or is it possible to reset nonce for my address or at least withdraw my funds? Or how do the site get the nonce? I checked its network activity, there's nothing like nonce. Or how do nonce generates? I wrote to the support in telegram, but they dont understand what im talking about, they think i just have an issue with nonce and cant use API, but i cant use ANYTHING now :(

Invalid cancel Signature

const raw = soliditySha3({
t: 'bytes32',
v: args.orderHash
}, {
t: 'uint256',
v: args.nonce
});
const salted = hashPersonalMessage(toBuffer(raw));
const vrs = mapValues(ecsign(salted, toBuffer('private_key')), (value, key) => key === 'v' ? value : bufferToHex(value));

const args2 = Object.assign(args, vrs);
response.end(JSON.stringify(args2))

What's wrong?

websocket API

Are you going to update any of you websocket API documentation? There's nothing indicating what data is available. At this point the only thing returnable is the message stating that the subscribe is a success.

OrderBook and OpenOrders errors

{
"market" : "ETH_ELEC"
}
returns
{
"error": "Market ETH_ELEC not found"
}

Another function openorders returns
"error": "Cannot read property 'toLowerCase' of undefined"

Is this web API working properly or is this in maintenance mode?

I cant use set_wallet_address

address I'm not change before.
but today I have some error in line lib/python3.5/site-packages/idex/client.py", line 170, in set_wallet_address

The api server is offline

https://api.idex.market/

This page (https://api.idex.market/) is currently offline. However, because the site uses Cloudflare's Always Online™ technology you can continue to surf a snapshot of the site. We will keep checking in the background and, as soon as the site comes back, you will automatically be served the live version. Always Online™ is powered by Cloudflare | Hide this Alert

Invalid order signature

I'm trying to open order through API.

This is my payload:
{"contractAddress":"0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208",
"tokenBuy":"0x0000000000000000000000000000000000000000",
"amountBuy":"50000000000000000",
"tokenSell":"0xcdcfc0f66c522fd086a1b725ea3c0eeb9f9e8814",
"amountSell":"100000000000000000000",
"expires":10000,
"nonce":1,
"address":"0x351296f44a5bf3f05eaa7d78a560f50dd736b728",
"v":28,
"r":"0xf58101acdb189a21a18d4b504b124dbfd3cfe67126b2fdc132eb3b3dea86664a",
"s":"0x50100b3e391b4fed0e6dcf81e3c833b971506b48d5c837bb81bbb1c6240c4c61"}

Private key: 0xce8291ae3e3f6db1f7d763fa543c1aa7c76080f69880d695bf131f4ca7bde67a

But it returns the error:
{"error":"Invalid order signature. Please try again."}

What's wrong with order signature? What v, r, s parameters values should be in this case? Please, help!

API not working

Hi,

I am trying to retrieve the ask and bids data using the api but it is not working.

When I do it through returnTicker, the ask and bids fields are always N/A. When I do it through returnOrderBook, it returns an empty object when no JSON is specified and when I specify a JSON, it returns that the market can't be found.

Could someone look into this please!

Session ID Mismatch

Hi,
I'm trying to establish a reliable connection to the v1 websocket api,
I'm able to connect and perform the handshake correctly, I get a response like

{"sid":"XXXXXXX","result":"success","format":"json","method":"handshake","payload":{}}

after that one I start receiving the correct data, but after a couple o seconds the server closes the socket connection with reason: 412, Session ID Mismatch.

any idea why? Should I use the sid parameter received after the handshake request? If yes how?

Thank you

Wrong type in returnTradeHistory

It seems that there is a bug in the "returnTradeHistory" API. The "type" field is always filled with "buy" value, even when the order is a sell order... So how to differentiate a buy and sell order in the returned history?

How to extract name or id of coin?

when we query for all possible tickers we get this kind of response but here we don`t have any key associated with names like no key is associated with ETH_SAN value, could you please tell me how we are suppose to extract name from this object i am using nodejs.
{
ETH_SAN:
{ last: '0.000981',
high: '0.0010763',
low: '0.0009777',
lowestAsk: '0.00098151',
highestBid: '0.0007853',
percentChange: '-1.83619353',
baseVolume: '7.3922603247161',
quoteVolume: '7462.998433' },
ETH_LINK:
{ last: '0.001',
high: '0.0014',
low: '0.001',
lowestAsk: '0.002',
highestBid: '0.001',
percentChange: '-28.57142857',
baseVolume: '13.651606265667369466',
quoteVolume: '9765.891979953083752189' }
// all possible markets follow ...
}

couldn't recover public key from signature

I'm trying to buy AURA, using C# (API call "order"). But it returns:
{"error":"couldn't recover public key from signature"}
Please help me to find out on which step I've mistaken.

Wallet: 0x351296f44a5bf3f05eaa7d78a560f50dd736b728
Private key: 0xce8291ae3e3f6db1f7d763fa543c1aa7c76080f69880d695bf131f4ca7bde67a

This is arguments:
"contractAddress":"0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208",
"tokenBuy":"0xcdcfc0f66c522fd086a1b725ea3c0eeb9f9e8814",
"amountBuy":"139611895000864697098",
"tokenSell":"0x0000000000000000000000000000000000000000",
"amountSell":"40000000000000000",
"expires":10000,
"nonce":2,
"address":"0x351296f44a5bf3f05eaa7d78a560f50dd736b728"

  1. This is arguments string in hex:
    0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208cdcfc0f66c522fd086a1b725ea3c0eeb9f9e8814000000000000000000000000000000000000000000000007918116cec9acab0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008e1bc9bf04000000000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000002351296f44a5bf3f05eaa7d78a560f50dd736b728

  2. This is the hash of arguments string (raw):
    0x42829b360851b370442abe990de6aa4719918c887f172f1ad7f8415f6b0430ba

  3. This is the hash of raw with prefix \x19Ethereum Signed Message:\n32 (salted):
    0x1481258241d0bb45803c5efc22caaaf6d9301aff5b19fe8e119936cf0e77aa94

  4. This is API call properties with signature:

{"contractAddress":"0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208",
"tokenBuy":"0xcdcfc0f66c522fd086a1b725ea3c0eeb9f9e8814",
"amountBuy":"139611895000864697098",
"tokenSell":"0x0000000000000000000000000000000000000000",
"amountSell":"40000000000000000",
"expires":10000,
"nonce":2,
"address":"0x351296f44a5bf3f05eaa7d78a560f50dd736b728",
"v":27,
"r":"0x02edb1229ffd4f53b17c41bd016d1846c21774cc6f74f1863d11ab7cb62e9f55",
"s":"0x035fa7351c3c4d2fbddd6d9248e1295b21df1d8b0d554fa744cb0e406db046a7"}

I also will be very grateful for the example similar to the above with right values.

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.