Comments (5)
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.
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.
Formating as api.placeOrder({"side":"buy","symbol":"WXT-USDT","type":"limit","price":"0.007778","size":"20"})
Returns undefined
from kucoin-node-api.
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.
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)
- Websocket 'orders' HOT 2
- What am I doing wrong? (spot limit order) HOT 2
- getSymbols API not working with market parameter HOT 1
- how to get Callback when websocket closed... HOT 6
- Update ws version HOT 1
- [WS] Invalid URL: undefined on sandbox HOT 1
- Closing ws stream HOT 4
- J HOT 1
- Typescript Interfaces HOT 4
- Problem with "PRIVATE" endpoint HOT 1
- Remove node_modules
- How to configure proxy? HOT 1
- code
- Add "Place Bulk Orders"
- 0 dealFunds/dealSize after successful trade
- borrowing & lending data?
- Websockets for Public topics not providing sign fails.
- Get Funding Rate Function
- having issue with Margin Trading
- ^ TypeError: Cannot read properties of undefined (reading 'init') HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kucoin-node-api.