Coder Social home page Coder Social logo

Error 400005 about kucoin-node-api HOT 5 CLOSED

escwdev avatar escwdev commented on August 20, 2024
Error 400005

from kucoin-node-api.

Comments (5)

escwdev avatar escwdev commented on August 20, 2024

I've placed a lot of orders through this library and generally don't have issues apart from the occasional failures due to 503 Unavailable Server or insuffient balance etc...

That said I use pretty much the same parameters apart from side/symbol/quantity. This makes me think the issue may be related to the parameters. If one isn't inputted correctly, the header signature would be invalid and may send back the error you're getting.

Can we have an example of your call?

from kucoin-node-api.

eyefate avatar eyefate commented on August 20, 2024

api.placeOrder(side="buy",symbol="WXT-USDT",type="limit",price="0.007778",size="20").then((r) => {
console.log(r.data)
}).catch((e) => {
console.log(e)
})

from kucoin-node-api.

eyefate avatar eyefate commented on August 20, 2024

Formating as api.placeOrder({"side":"buy","symbol":"WXT-USDT","type":"limit","price":"0.007778","size":"20"}) Returns undefined

from kucoin-node-api.

escwdev avatar escwdev commented on August 20, 2024

clientOid is a required parameter so that could be your issue. I use a uuid for it but it can be any unique value (i.e. if you use 1 and try to use 1 again the 2nd trade will fail). For quick testing and no added dependencies, Date.now() can work well since it should always be unique (unless you are sending a lot of orders at once in which case I recommend using uuid).

Also, you don't need to stringify your requests, the library handles that for you so this should work.

api.placeOrder({
  clientOid: Date.now(),
  side: "buy",
  symbol: "WXT-USDT",
  type: "limit",         // Note limit is default so this can be omitted
  price: 0.007778,
  size: 20
}).then(r => console.log(r.data)).catch(e => console.log(e));

Let me know if that works for you.

from kucoin-node-api.

eyefate avatar eyefate commented on August 20, 2024

Working now, was my fault, i had to move funds to trade account apparently and error showed as undefined, have a good one!

;)

from kucoin-node-api.

Related Issues (20)

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.