Solvedzenbot The Error at the Binance "More than 1 hours between startTime and endTime"

Hi, guys,
While trading, an error occurred below.
Do you know the reason?

I use ubuntu 16.04.

An error occurred { Error: binance GET https://api.binance.com/api/v1/aggTrades?symbol=XRPBTC&startTime=1514038924092&endTime=1514082124092 400 Bad Request {"code":-1127,"msg":"More than 1 hours between startTime and endTime."} (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting)
at binance.defaultErrorHandler (/home/satoko/zenbot/node_modules/ccxt/js/base/Exchange.js:400:15)
at response.text.then.text (/home/satoko/zenbot/node_modules/ccxt/js/base/Exchange.js:413:25)
at
at process._tickCallback (internal/process/next_tick.js:188:7) constructor: [Function: ExchangeNotAvailable] }

11 Answers

✔️Accepted Answer

Change this in extensions/exchanges/binance/exchange.js

  getTrades: function (opts, cb) {
        var func_args = [].slice.call(arguments)

        var args = {};
        if (opts.from) {
          args.startTime = opts.from
        }
        if (opts.to) {
          args.endTime = opts.to
        }
        if (args.startTime && !args.endTime) {
          // add 1 hour instead of 12
          args.endTime = args.startTime + 3600000
        }
        else if (args.endTime && !args.startTime) {
          // subtract only 1 hour instead of 12
          args.startTime = args.endTime - 3600000
        }

// Credit to jadedgeek on discord

Related Issues:

8
zenbot The Error at the Binance "More than 1 hours between startTime and endTime"
Change this in extensions/exchanges/binance/exchange.js // Credit to jadedgeek on discord ...
6
zenbot Cannot find module './build/Release/analytics.node'
Guys please upgrade to nodejs 8 that should solve the build problem Please make sure to rm -rf node_...
3831
axios Axios catch error returns javascript error not server response
I have exactly the same environment Try this: Modify from console.log(error) to console.log(error.re...
752
nvm .nvmrc example?
If you're currently using the Node version you want for .nvmrc you can run this command: node -v > ....
744
nvm -bash: nvm: command not found
I had the same issue until I added the following lines to my .bash_profile Running terminal in Mac O...
627
nvm nvm install node fails to install on macOS Big Sur M1 Chip
For anything under v15 you will need to install node using Rosetta 2 You can do this by running the ...
595
react starter kit How to call child component method from parent?
For example you can use Refs to Components approach like so: Demo: https://jsfiddle.net/frenzzy/z9c4...
548
svgo no such file or directory .svgo.yml
I noticed this problem with Yarn after someone had run yarn clean Deleting the .yarnclean file delet...
506
electron Requiring electron outside of main.js causes a TypeError
For anyone encountering this problem in the future and reading this thread Electron version: 1.3.5 O...
474
meteor [1.4.2.1] Error: ENFILE: file table overflow
I was getting the same after an upgrade to macOS Sierra Turns out macOS have a harsh limit on number...
418
node gyp Is this an Issue with MACOS catalina?
This worked for me EDITED FOR PEOPLE JUST GETTING HERE: node-gyp v7 should solve these issues ...
352
axios POST request works in Browser but not on Node
This might be considered a duplicate of #789 I was able to use the form-data package with Axios in n...
345
node gyp trying to 'npm install', getting node-gyp rebuild errors
Delete your $HOME/.node-gyp directory and try again Aside many tools don't handle spaces in path nam...
303
ts node Custom typings not working with ts-node 8.0.2
When using with ts-node you have to add --files flag After updating to ts-node version 8.0.2 the cus...
287
nvm How to uninstall nvm?
@mibamur There is no need for such emphasis in your comments And it is probably better to use the $N...
262
date fns Can't resolve 'date-fns/_lib/format/longFormatters'
You probably forgot to install date-fns or Code: import DateFnsUtils from '@date-io/date-fns'; ...
246
sheetjs How to simply export a Worksheet to xlsx?
There are two issues: each object is mapped to a row so if you want a row with name John and city Se...
238
axios Adding headers to axios.post method
Edit: I had to add Authorization to allowed headers in my CORS filter @jffernandez I'm having the sa...
236
electron Error while importing electron in react | import { ipcRenderer } from 'electron'
@MarshallOfSound my mistake I found the solution in issue #7300 if it can help anyone Please note th...
232
passenger passenger-install-apache2-module fails with OpenSSL development headers not found on OSX El Capitan
After upgrading to El Capitan I'm unable to install the Apache module by running passenger-install-a...
231
axios Adding Retry Parameter
@mericsson I am too in need of exponential backoff when retrying I've put together the following whi...
230
jsdom jest : SecurityError: localStorage is not available for opaque origins
@gokulkrishh I set it to http://localhost/ but any valid URL seems to work. When I run a jest with m...
230
mocha timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
just add in your package.json under scripts Then you can just run I'm getting the following error wh...
229
electron Failed to load resource: net::ERR_FILE_NOT_FOUND file:///D:/css/app.css
If this occur when having <base href=/> in the index.html just replace it by <base href=./>. ...
215
axios BaseURL not being used
Please IGNORE THIS ISSUE Found the problem: I was setting baseUrl but it should be baseURL. ...
205
axios How to ignore SSL issues
You can configure axios to use a custom agent and set rejectUnauthorized to false for that agent: Ho...
204
electron Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
Try It should output a progress bar for the download 👍 Electron version: latest (That Try) Operatin...
191
cli [BUG] Missing required argument #1
Same problem It appears something was released that breaks older versions of npm (we were using 3.5....
190
axios How to send Raw http for Instagram Authentication?
Yes StringClient uses the application/x-www-form-urlencoded format by default while axios uses appli...
182
axios CORS error No 'Access-Control-Allow-Origin' header is present on the requested resource
My solution is axios.get('https://cors-anywhere.herokuapp.com/' + yourUrl) update: doesn't work ...
179
nvm NVM is not compatible with the npm config "prefix" option warning (OS X)
nvm unalias default worked for me! Much appreciated @MwumLi 🍻 Split off from #855 ; see that issue ...
175
electron How do I open a url from <a> on default OS browser?
I found this code snippet on S.O.: Dropped it in my main index file it seems to be working as far as...
174
axios request progress?
@slim12kg Depending on the way you coded your project it may change if my code confuses you ...
170
node gyp Warning "root" does not have permission to access the dev dir
Solved it be adding --unsafe-perm In my case with sails: Works well! For people coming here through ...
163
ts node ts-node fails when ES Modules are in the dependency graph in Node.js 13+
It seems that ts-node fails to run with module: esnext in the tsconfig.json and type: module in the ...
162
node gyp error C2373: '__pfnDliNotifyHook2': redefinition;
npm -g install npm@next? ERR WHILE ENV ...
159
axios Missing documentation for downloading binary files
In case other stumple upon this thread when looking for an answer to serve external images from node...
155
node Error: Cannot find module 'internal/fs' when npm install on mac
If you run rm -rf /usr/local/lib/node_modules/npm and then re-install Node.js does it work? ...
150
axios Is it possible to add a retry method to axios?
You can do that with an interceptor that handles authentication errors Something like: ...
149
freeCodeCamp Test failing in: Applied Visual Design: Create a Horizontal Line Using the hr Element
Try to switch you <p><em> tag like this. This work for me. Hope it helps for someone who want to pas...
147
express What is the default timeout of a req in express?
@flickz @vitoravale I've found two ways to make it work Uploading a blob on azure storage and at tim...
147
node Missing stack traces from async functions after the first await
Thanks! And to put a point on the real problem Version: v7.7.3 Platform: Windows 7x64 The purpose of...
141
axios Example for how to chain multiple requests?
You can chain the results as they are regular promises: Can anyone point me to an example or share a...
139
electron 9.0.0 does not display local images
A recap for anyone else who's having this issue: Make sure you've enabled webSecurity from your Brow...
135
apostrophe PayloadTooLargeError: request entity too large when trying to POST to apostrophe-headless API
This seems to have worked: I am using apostrophe-headless and my payloads are slightly big since I a...
134
axios Can't get a .post with 'Content-Type': 'multipart/form-data' to work
@rafaelbiten I've just tried to reproduce the issue but to no avail I used the following code: The d...
134
axios Set a code/status for "Network Error"
I'm having this issue I'm trying to detect when my server is down so that I can display an appropria...
130
nvm NVM fails to load within nested shell
For me Operating system and version: macOS High Sierra 10.13.1 (17B48) nvm debug output: nvm ls outp...
130
prisma Prisma Migrate: Error creating shadow database
I just want to add a quick note for folks coming here from googling the error message that if you ar...