glazec / n8n-nodes-binance

MIT License
0 stars 1 forks source link

Got Error failed with status code 400 #1

Open Amadoflimd opened 11 months ago

Amadoflimd commented 11 months ago

AxiosError: Request failed with status code 400\n at settle (/home/node/.n8n/nodes/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (/home/node/.n8n/nodes/node_modules/axios/lib/adapters/http.js:585:11)\n at IncomingMessage.emit (node:events:529:35)\n at IncomingMessage.emit (node:domain:552:15)\n at endReadableNT (node:internal/streams/readable:1368:12)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)

why ×tamp=? is timestamp in the header.

glazec commented 11 months ago

Normally the problem is

The Binance API does not permit calls from IP addresses in the US and other restricted countries. Your order price must align with the current order book. For instance, placing a $10 buy order for a token trading at $70 is not feasible. Decimal pecisions for quantity and price

Amadoflimd commented 11 months ago

I'm using Market. In Market; Price is not needed. Also why you are assuming everyone use LIMIT?. I'm in a supported country. I can send with postman.

Glazec Node: Market Result: /api/v3/order?timeInForce=GTC&quantity=1&price=1&symbol=BTCUSDT&side=BUY&type=MARKET×tamp=1702487202138

  1. TimeInForce is not needed when Market.
  2. why xtamp?. is timestamp
  3. Price is not needed on Market.

PostMan Working Market Result: : https://api.binance.com/api/v3/order?symbol=BTCUSDT&side=BUY&type=MARKET&quantity=1&timestamp=somenumber&signature=somesignature.

glazec commented 11 months ago

Yeah. That's a bug. I will try to fix this. Maybe you can also try this one https://www.npmjs.com/package/n8n-nodes-binance

Amadoflimd commented 11 months ago

Solved on my fork, created a pull request if you want merge. btw thanks for the node module.