bmino / binance-triangle-arbitrage

Detect in-market cryptocurrency arbitrage
MIT License
1.07k stars 336 forks source link

How can I solve this problem? #94

Closed chalitgubkb closed 4 years ago

chalitgubkb commented 4 years ago

How can I solve this problem?

node src/main/Main.js

Successfully pinged the Binance api in 247 ms [ 'balanceData error', {} ] IncomingMessage { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: null, pipesCount: 0, flowing: true, ended: true, endEmitted: true, reading: false, sync: false, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, paused: false, emitClose: true, autoDestroy: false, destroyed: false, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: false, decoder: null, encoding: null }, readable: false, _events: [Object: null prototype] { end: [ [Function: responseOnEnd], [Function] ], close: [ [Function], [Function] ], data: [Function], error: [Function] }, _eventsCount: 4, _maxListeners: undefined, socket: TLSSocket { _tlsOptions: { pipe: false, secureContext: [SecureContext], isServer: false, requestCert: true, rejectUnauthorized: true, session: <Buffer 30 82 07 82 02 01 01 02 02 03 03 04 02 c0 2f 04 20 b6 d0 a5 3a 52 71 cc bc 9b b6 59 e6 3a 0f 89 f1 15 4c 15 18 62 bf 2b d0 6d cc b0 77 20 2c f5 ab 04 ... 1876 more bytes>, ALPNProtocols: undefined, requestOCSP: undefined }, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: 'api.binance.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype] { close: [Array], end: [Function: onReadableStreamEnd], secure: [Function: onConnectSecure], session: [Function], free: [Function: onFree], agentRemove: [Function: onRemove], drain: [Function: ondrain], error: [Function: socketErrorListener], finish: [Function] }, _eventsCount: 9, connecting: false, _hadError: false, _handle: TLSWrap { _parent: [TCP], _parentWrap: undefined, _secureContext: [SecureContext], reading: true, onread: [Function: onStreamRead], onhandshakestart: [Function: noop], onhandshakedone: [Function: bound ], onocspresponse: [Function: onocspresponse], onnewsession: [Function: onnewsessionclient], onerror: [Function: onerror], [Symbol(owner)]: [Circular] }, _parent: null, _host: 'api.binance.com', _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: null, pipesCount: 0, flowing: true, ended: false, endEmitted: false, reading: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, paused: false, emitClose: false, autoDestroy: false, destroyed: false, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: false, decoder: null, encoding: null }, readable: true, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 1, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: TLSWrap { _parent: [TCP], _parentWrap: undefined, _secureContext: [SecureContext], reading: true, onread: [Function: onStreamRead], onhandshakestart: [Function: noop], onhandshakedone: [Function: bound ], onocspresponse: [Function: onocspresponse], onnewsession: [Function: onnewsessionclient], onerror: [Function: onerror], [Symbol(owner)]: [Circular] }, _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: ClientRequest { _events: [Object], _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Circular], connection: [Circular], _header: 'GET /api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21 HTTP/1.1\r\nUser-Agent: Mozilla/4.0 (compatible; Node Binance API)\r\nContent-type: application/x-www-form-urlencoded\r\nX-MBX-APIKEY: G9iw1xAfKl37sRwC1p8G1A1LXgJfeRLWAGJnVzfutkAz7m9nGwBEi84jtYiEUi0j\r\nhost: api.binance.com\r\nConnection: close\r\n\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, timeout: undefined, method: 'GET', path: '/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', _ended: true, res: [Circular], aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null,

    [Symbol(outHeadersKey)]: [Object] },
 timeout: 5000,
 [Symbol(res)]:
  TLSWrap {
    _parent: [TCP],
    _parentWrap: undefined,
    _secureContext: [SecureContext],
    reading: true,
    onread: [Function: onStreamRead],
    onhandshakestart: [Function: noop],
    onhandshakedone: [Function: bound ],
    onocspresponse: [Function: onocspresponse],
    onnewsession: [Function: onnewsessionclient],
    onerror: [Function: onerror],
    [Symbol(owner)]: [Circular] },
 [Symbol(asyncId)]: 123,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]:
  Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [TimersList],
    _idleStart: 1897,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(asyncId)]: 133,
    [Symbol(triggerId)]: 131 },
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0,
 [Symbol(connect-options)]:
  { rejectUnauthorized: true,
    ciphers:
     'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
    checkServerIdentity: [Function: checkServerIdentity],
    minDHSize: 1024,
    session:
     <Buffer 30 82 07 82 02 01 01 02 02 03 03 04 02 c0 2f 04 20 b6 d0 a5 3a 52 71 cc bc 9b b6 59 e6 3a 0f 89 f1 15 4c 15 18 62 bf 2b d0 6d cc b0 77 20 2c f5 ab 04 ... 1876 more bytes>,
    _events: [Object],
    _eventsCount: 3,
    _maxListeners: undefined,
    method: 'GET',
    headers: [Object],
    callback: [Function],
    readable: true,
    writable: true,
    explicitMethod: true,
    _qs: [Querystring],
    _auth: [Auth],
    _oauth: [OAuth],
    _multipart: [Multipart],
    _redirect: [Redirect],
    _tunnel: [Tunnel],
    setHeader: [Function],
    hasHeader: [Function],
    getHeader: [Function],
    removeHeader: [Function],
    localAddress: undefined,
    pool: {},
    dests: [],
    __isRequestRequest: true,
    _callback: [Function],
    uri: [Url],
    proxy: null,
    tunnel: true,
    setHost: true,
    originalCookieHeader: undefined,
    _disableCookies: true,
    _jar: undefined,
    port: 443,
    host: 'api.binance.com',
    url: [Url],
    path: null,
    httpModule: [Object],
    agentClass: [Function: Agent],
    agent: [Agent],
    _started: true,
    href:
     'https://api.binance.com/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21',
    secureEndpoint: true,
    _defaultAgent: [Agent],
    servername: 'api.binance.com',
    _agentKey: 'api.binance.com:443::::::::::::::::::',
    encoding: null,
    singleUse: true } },

connection: TLSSocket { _tlsOptions: { pipe: false, secureContext: [SecureContext], isServer: false, requestCert: true, rejectUnauthorized: true, session: <Buffer 30 82 07 82 02 01 01 02 02 03 03 04 02 c0 2f 04 20 b6 d0 a5 3a 52 71 cc bc 9b b6 59 e6 3a 0f 89 f1 15 4c 15 18 62 bf 2b d0 6d cc b0 77 20 2c f5 ab 04 ... 1876 more bytes>, ALPNProtocols: undefined, requestOCSP: undefined }, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: 'api.binance.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype] { close: [Array], end: [Function: onReadableStreamEnd], secure: [Function: onConnectSecure], session: [Function], free: [Function: onFree], agentRemove: [Function: onRemove], drain: [Function: ondrain], error: [Function: socketErrorListener], finish: [Function] }, _eventsCount: 9, connecting: false, _hadError: false, _handle: TLSWrap { _parent: [TCP], _parentWrap: undefined, _secureContext: [SecureContext], reading: true, onread: [Function: onStreamRead], onhandshakestart: [Function: noop], onhandshakedone: [Function: bound ], onocspresponse: [Function: onocspresponse], onnewsession: [Function: onnewsessionclient], onerror: [Function: onerror], [Symbol(owner)]: [Circular] }, _parent: null, _host: 'api.binance.com', _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: null, pipesCount: 0, flowing: true, ended: false, endEmitted: false, reading: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, paused: false, emitClose: false, autoDestroy: false, destroyed: false, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: false, decoder: null, encoding: null }, readable: true, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 1, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: TLSWrap { _parent: [TCP], _parentWrap: undefined, _secureContext: [SecureContext], reading: true, onread: [Function: onStreamRead], onhandshakestart: [Function: noop], onhandshakedone: [Function: bound ], onocspresponse: [Function: onocspresponse], onnewsession: [Function: onnewsessionclient], onerror: [Function: onerror], [Symbol(owner)]: [Circular] }, _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: ClientRequest { _events: [Object], _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Circular], connection: [Circular], _header: 'GET /api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21 HTTP/1.1\r\nUser-Agent: Mozilla/4.0 (compatible; Node Binance API)\r\nContent-type: application/x-www-form-urlencoded\r\nX-MBX-APIKEY: G9iw1xAfKl37sRwC1p8G1A1LXgJfeRLWAGJnVzfutkAz7m9nGwBEi84jtYiEUi0j\r\nhost: api.binance.com\r\nConnection: close\r\n\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, timeout: undefined, method: 'GET', path: '/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', _ended: true, res: [Circular], aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null,

    [Symbol(outHeadersKey)]: [Object] },
 timeout: 5000,
 [Symbol(res)]:
  TLSWrap {
    _parent: [TCP],
    _parentWrap: undefined,
    _secureContext: [SecureContext],
    reading: true,
    onread: [Function: onStreamRead],
    onhandshakestart: [Function: noop],
    onhandshakedone: [Function: bound ],
    onocspresponse: [Function: onocspresponse],
    onnewsession: [Function: onnewsessionclient],
    onerror: [Function: onerror],
    [Symbol(owner)]: [Circular] },
 [Symbol(asyncId)]: 123,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]:
  Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [TimersList],
    _idleStart: 1897,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(asyncId)]: 133,
    [Symbol(triggerId)]: 131 },
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0,
 [Symbol(connect-options)]:
  { rejectUnauthorized: true,
    ciphers:
     'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
    checkServerIdentity: [Function: checkServerIdentity],
    minDHSize: 1024,
    session:
     <Buffer 30 82 07 82 02 01 01 02 02 03 03 04 02 c0 2f 04 20 b6 d0 a5 3a 52 71 cc bc 9b b6 59 e6 3a 0f 89 f1 15 4c 15 18 62 bf 2b d0 6d cc b0 77 20 2c f5 ab 04 ... 1876 more bytes>,
    _events: [Object],
    _eventsCount: 3,
    _maxListeners: undefined,
    method: 'GET',
    headers: [Object],
    callback: [Function],
    readable: true,
    writable: true,
    explicitMethod: true,
    _qs: [Querystring],
    _auth: [Auth],
    _oauth: [OAuth],
    _multipart: [Multipart],
    _redirect: [Redirect],
    _tunnel: [Tunnel],
    setHeader: [Function],
    hasHeader: [Function],
    getHeader: [Function],
    removeHeader: [Function],
    localAddress: undefined,
    pool: {},
    dests: [],
    __isRequestRequest: true,
    _callback: [Function],
    uri: [Url],
    proxy: null,
    tunnel: true,
    setHost: true,
    originalCookieHeader: undefined,
    _disableCookies: true,
    _jar: undefined,
    port: 443,
    host: 'api.binance.com',
    url: [Url],
    path: null,
    httpModule: [Object],
    agentClass: [Function: Agent],
    agent: [Agent],
    _started: true,
    href:
     'https://api.binance.com/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21',
    secureEndpoint: true,
    _defaultAgent: [Agent],
    servername: 'api.binance.com',
    _agentKey: 'api.binance.com:443::::::::::::::::::',
    encoding: null,
    singleUse: true } },

httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, headers: { 'content-type': 'application/json;charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', date: 'Sat, 04 Apr 2020 04:59:08 GMT', server: 'nginx', 'x-mbx-uuid': 'bee0410c-b79f-46e1-bc70-33c84f801457', 'x-mbx-used-weight': '10', 'x-mbx-used-weight-1m': '10', 'strict-transport-security': 'max-age=31536000; includeSubdomains', 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'content-security-policy': "default-src 'self'", 'x-content-security-policy': "default-src 'self'", 'x-webkit-csp': "default-src 'self'", 'cache-control': 'no-cache, no-store, must-revalidate', pragma: 'no-cache', expires: '0', 'x-cache': 'Error from cloudfront', via: '1.1 824b6b17b59323f523bbeab054eeb246.cloudfront.net (CloudFront)', 'x-amz-cf-pop': 'SIN52-C2', 'x-amz-cf-id': 'rNgEzZtgTSvZ5lAc9R_0U5LUpkO3o91gKNACyxtloMR2vrCmET0oGg==' }, rawHeaders: [ 'Content-Type', 'application/json;charset=utf-8', 'Transfer-Encoding', 'chunked', 'Connection', 'close', 'Date', 'Sat, 04 Apr 2020 04:59:08 GMT', 'Server', 'nginx', 'X-MBX-UUID', 'bee0410c-b79f-46e1-bc70-33c84f801457', 'X-MBX-USED-WEIGHT', '10', 'X-MBX-USED-WEIGHT-1M', '10', 'Strict-Transport-Security', 'max-age=31536000; includeSubdomains', 'X-Frame-Options', 'SAMEORIGIN', 'X-Xss-Protection', '1; mode=block', 'X-Content-Type-Options', 'nosniff', 'Content-Security-Policy', "default-src 'self'", 'X-Content-Security-Policy', "default-src 'self'", 'X-WebKit-CSP', "default-src 'self'", 'Cache-Control', 'no-cache, no-store, must-revalidate', 'Pragma', 'no-cache', 'Expires', '0', 'X-Cache', 'Error from cloudfront', 'Via', '1.1 824b6b17b59323f523bbeab054eeb246.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop', 'SIN52-C2', 'X-Amz-Cf-Id', 'rNgEzZtgTSvZ5lAc9R_0U5LUpkO3o91gKNACyxtloMR2vrCmET0oGg==' ], trailers: {}, rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 400, statusMessage: 'Bad Request', client: TLSSocket { _tlsOptions: { pipe: false, secureContext: [SecureContext], isServer: false, requestCert: true, rejectUnauthorized: true, session: <Buffer 30 82 07 82 02 01 01 02 02 03 03 04 02 c0 2f 04 20 b6 d0 a5 3a 52 71 cc bc 9b b6 59 e6 3a 0f 89 f1 15 4c 15 18 62 bf 2b d0 6d cc b0 77 20 2c f5 ab 04 ... 1876 more bytes>, ALPNProtocols: undefined, requestOCSP: undefined }, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: 'api.binance.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype] { close: [Array], end: [Function: onReadableStreamEnd], secure: [Function: onConnectSecure], session: [Function], free: [Function: onFree], agentRemove: [Function: onRemove], drain: [Function: ondrain], error: [Function: socketErrorListener], finish: [Function] }, _eventsCount: 9, connecting: false, _hadError: false, _handle: TLSWrap { _parent: [TCP], _parentWrap: undefined, _secureContext: [SecureContext], reading: true, onread: [Function: onStreamRead], onhandshakestart: [Function: noop], onhandshakedone: [Function: bound ], onocspresponse: [Function: onocspresponse], onnewsession: [Function: onnewsessionclient], onerror: [Function: onerror], [Symbol(owner)]: [Circular] }, _parent: null, _host: 'api.binance.com', _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: null, pipesCount: 0, flowing: true, ended: false, endEmitted: false, reading: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, paused: false, emitClose: false, autoDestroy: false, destroyed: false, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: false, decoder: null, encoding: null }, readable: true, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: true, needDrain: false, ending: true, ended: true, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: false, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 1, prefinished: false, errorEmitted: false, emitClose: false, autoDestroy: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: TLSWrap { _parent: [TCP], _parentWrap: undefined, _secureContext: [SecureContext], reading: true, onread: [Function: onStreamRead], onhandshakestart: [Function: noop], onhandshakedone: [Function: bound ], onocspresponse: [Function: onocspresponse], onnewsession: [Function: onnewsessionclient], onerror: [Function: onerror], [Symbol(owner)]: [Circular] }, _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: ClientRequest { _events: [Object], _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Circular], connection: [Circular], _header: 'GET /api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21 HTTP/1.1\r\nUser-Agent: Mozilla/4.0 (compatible; Node Binance API)\r\nContent-type: application/x-www-form-urlencoded\r\nX-MBX-APIKEY: G9iw1xAfKl37sRwC1p8G1A1LXgJfeRLWAGJnVzfutkAz7m9nGwBEi84jtYiEUi0j\r\nhost: api.binance.com\r\nConnection: close\r\n\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, timeout: undefined, method: 'GET', path: '/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', _ended: true, res: [Circular], aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null,

    [Symbol(outHeadersKey)]: [Object] },
 timeout: 5000,
 [Symbol(res)]:
  TLSWrap {
    _parent: [TCP],
    _parentWrap: undefined,
    _secureContext: [SecureContext],
    reading: true,
    onread: [Function: onStreamRead],
    onhandshakestart: [Function: noop],
    onhandshakedone: [Function: bound ],
    onocspresponse: [Function: onocspresponse],
    onnewsession: [Function: onnewsessionclient],
    onerror: [Function: onerror],
    [Symbol(owner)]: [Circular] },
 [Symbol(asyncId)]: 123,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]:
  Timeout {
    _idleTimeout: 5000,
    _idlePrev: [TimersList],
    _idleNext: [TimersList],
    _idleStart: 1897,
    _onTimeout: [Function: bound ],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(asyncId)]: 133,
    [Symbol(triggerId)]: 131 },
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0,
 [Symbol(connect-options)]:
  { rejectUnauthorized: true,
    ciphers:
     'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',
    checkServerIdentity: [Function: checkServerIdentity],
    minDHSize: 1024,
    session:
     <Buffer 30 82 07 82 02 01 01 02 02 03 03 04 02 c0 2f 04 20 b6 d0 a5 3a 52 71 cc bc 9b b6 59 e6 3a 0f 89 f1 15 4c 15 18 62 bf 2b d0 6d cc b0 77 20 2c f5 ab 04 ... 1876 more bytes>,
    _events: [Object],
    _eventsCount: 3,
    _maxListeners: undefined,
    method: 'GET',
    headers: [Object],
    callback: [Function],
    readable: true,
    writable: true,
    explicitMethod: true,
    _qs: [Querystring],
    _auth: [Auth],
    _oauth: [OAuth],
    _multipart: [Multipart],
    _redirect: [Redirect],
    _tunnel: [Tunnel],
    setHeader: [Function],
    hasHeader: [Function],
    getHeader: [Function],
    removeHeader: [Function],
    localAddress: undefined,
    pool: {},
    dests: [],
    __isRequestRequest: true,
    _callback: [Function],
    uri: [Url],
    proxy: null,
    tunnel: true,
    setHost: true,
    originalCookieHeader: undefined,
    _disableCookies: true,
    _jar: undefined,
    port: 443,
    host: 'api.binance.com',
    url: [Url],
    path: null,
    httpModule: [Object],
    agentClass: [Function: Agent],
    agent: [Agent],
    _started: true,
    href:
     'https://api.binance.com/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21',
    secureEndpoint: true,
    _defaultAgent: [Agent],
    servername: 'api.binance.com',
    _agentKey: 'api.binance.com:443::::::::::::::::::',
    encoding: null,
    singleUse: true } },

_consuming: true, _dumped: false, req: ClientRequest { _events: [Object: null prototype] { socket: [Function], response: [Function: bound ], error: [Array], drain: [Function], timeout: [Function], prefinish: [Function: requestOnPrefinish] }, _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, _SNICallback: null, servername: 'api.binance.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object], _eventsCount: 9, connecting: false, _hadError: false, _handle: [TLSWrap], _parent: null, _host: 'api.binance.com', _readableState: [ReadableState], readable: true, _maxListeners: undefined, _writableState: [WritableState], writable: false, allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: [Circular], timeout: 5000,

    [Symbol(asyncId)]: 123,
    [Symbol(lastWriteQueueSize)]: 0,
    [Symbol(timeout)]:
     Timeout {
       _idleTimeout: 5000,
       _idlePrev: [TimersList],
       _idleNext: [TimersList],
       _idleStart: 1897,
       _onTimeout: [Function: bound ],
       _timerArgs: undefined,
       _repeat: null,
       _destroyed: false,
       [Symbol(refed)]: false,
       [Symbol(asyncId)]: 133,
       [Symbol(triggerId)]: 131 },
    [Symbol(kBytesRead)]: 0,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(connect-options)]: [Object] },
 connection:
  TLSSocket {
    _tlsOptions: [Object],
    _secureEstablished: true,
    _securePending: false,
    _newSessionPending: false,
    _controlReleased: true,
    _SNICallback: null,
    servername: 'api.binance.com',
    alpnProtocol: false,
    authorized: true,
    authorizationError: null,
    encrypted: true,
    _events: [Object],
    _eventsCount: 9,
    connecting: false,
    _hadError: false,
    _handle: [TLSWrap],
    _parent: null,
    _host: 'api.binance.com',
    _readableState: [ReadableState],
    readable: true,
    _maxListeners: undefined,
    _writableState: [WritableState],
    writable: false,
    allowHalfOpen: false,
    _sockname: null,
    _pendingData: null,
    _pendingEncoding: '',
    server: undefined,
    _server: null,
    ssl: [TLSWrap],
    _requestCert: true,
    _rejectUnauthorized: true,
    parser: null,
    _httpMessage: [Circular],
    timeout: 5000,
    [Symbol(res)]: [TLSWrap],
    [Symbol(asyncId)]: 123,
    [Symbol(lastWriteQueueSize)]: 0,
    [Symbol(timeout)]:
     Timeout {
       _idleTimeout: 5000,
       _idlePrev: [TimersList],
       _idleNext: [TimersList],
       _idleStart: 1897,
       _onTimeout: [Function: bound ],
       _timerArgs: undefined,
       _repeat: null,
       _destroyed: false,
       [Symbol(refed)]: false,
       [Symbol(asyncId)]: 133,
       [Symbol(triggerId)]: 131 },
    [Symbol(kBytesRead)]: 0,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(connect-options)]: [Object] },
 _header:
  'GET /api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21 HTTP/1.1\r\nUser-Agent: Mozilla/4.0 (compatible; Node Binance API)\r\nContent-type: application/x-www-form-urlencoded\r\nX-MBX-APIKEY: G9iw1xAfKl37sRwC1p8G1A1LXgJfeRLWAGJnVzfutkAz7m9nGwBEi84jtYiEUi0j\r\nhost: api.binance.com\r\nConnection: close\r\n\r\n',
 _onPendingData: [Function: noopPendingOutput],
 agent:
  Agent {
    _events: [Object],
    _eventsCount: 1,
    _maxListeners: undefined,
    defaultPort: 443,
    protocol: 'https:',
    options: [Object],
    requests: {},
    sockets: [Object],
    freeSockets: {},
    keepAliveMsecs: 1000,
    keepAlive: false,
    maxSockets: Infinity,
    maxFreeSockets: 256,
    maxCachedSessions: 100,
    _sessionCache: [Object] },
 socketPath: undefined,
 timeout: undefined,
 method: 'GET',
 path:
  '/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21',
 _ended: true,
 res: [Circular],
 aborted: false,
 timeoutCb: [Function: emitRequestTimeout],
 upgradeOrConnect: false,
 parser: null,
 maxHeadersCount: null,
 [Symbol(isCorked)]: false,
 [Symbol(outHeadersKey)]:
  [Object: null prototype] {
    'user-agent': [Array],
    'content-type': [Array],
    'x-mbx-apikey': [Array],
    host: [Array] } },

request: Request { _events: [Object: null prototype] { error: [Function: bound ], complete: [Function: bound ], pipe: [Function], data: [Function], end: [Function] }, _eventsCount: 5, _maxListeners: undefined, method: 'GET', timeout: 5000, headers: { 'User-Agent': 'Mozilla/4.0 (compatible; Node Binance API)', 'Content-type': 'application/x-www-form-urlencoded', 'X-MBX-APIKEY': 'G9iw1xAfKl37sRwC1p8G1A1LXgJfeRLWAGJnVzfutkAz7m9nGwBEi84jtYiEUi0j' }, callback: [Function], readable: true, writable: true, explicitMethod: true, _qs: Querystring { request: [Circular], lib: [Object], useQuerystring: undefined, parseOptions: {}, stringifyOptions: {} }, _auth: Auth { request: [Circular], hasAuth: false, sentAuth: false, bearerToken: null, user: null, pass: null }, _oauth: OAuth { request: [Circular], params: null }, _multipart: Multipart { request: [Circular], boundary: 'e865a7c7-f432-4c61-a2e3-dc37f66efc79', chunked: false, body: null }, _redirect: Redirect { request: [Circular], followRedirect: true, followRedirects: true, followAllRedirects: false, followOriginalHttpMethod: false, allowRedirect: [Function], maxRedirects: 10, redirects: [], redirectsFollowed: 0, removeRefererHeader: false }, _tunnel: Tunnel { request: [Circular], proxyHeaderWhiteList: [Array], proxyHeaderExclusiveList: [] }, setHeader: [Function], hasHeader: [Function], getHeader: [Function], removeHeader: [Function], localAddress: undefined, pool: {}, dests: [], __isRequestRequest: true, _callback: [Function], uri: Url { protocol: 'https:', slashes: true, auth: null, host: 'api.binance.com', port: null, hostname: 'api.binance.com', hash: null, search: '?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', query: 'timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', pathname: '/api/v3/account', path: '/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', href: 'https://api.binance.com/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21' }, proxy: null, tunnel: true, setHost: true, originalCookieHeader: undefined, _disableCookies: true, _jar: undefined, port: 443, host: 'api.binance.com', url: Url { protocol: 'https:', slashes: true, auth: null, host: 'api.binance.com', port: null, hostname: 'api.binance.com', hash: null, search: '?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', query: 'timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', pathname: '/api/v3/account', path: '/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', href: 'https://api.binance.com/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21' }, path: '/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', httpModule: { Agent: [Function: Agent], globalAgent: [Agent], Server: [Function: Server], createServer: [Function: createServer], get: [Function], request: [Function] }, agentClass: [Function: Agent], agent: Agent { _events: [Object], _eventsCount: 1, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object], requests: {}, sockets: [Object], freeSockets: {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, maxCachedSessions: 100, _sessionCache: [Object] }, _started: true, href: 'https://api.binance.com/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', req: ClientRequest { _events: [Object], _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [TLSSocket], connection: [TLSSocket], _header: 'GET /api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21 HTTP/1.1\r\nUser-Agent: Mozilla/4.0 (compatible; Node Binance API)\r\nContent-type: application/x-www-form-urlencoded\r\nX-MBX-APIKEY: G9iw1xAfKl37sRwC1p8G1A1LXgJfeRLWAGJnVzfutkAz7m9nGwBEi84jtYiEUi0j\r\nhost: api.binance.com\r\nConnection: close\r\n\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, timeout: undefined, method: 'GET', path: '/api/v3/account?timestamp=1585976342110&recvWindow=5000&signature=9bcc5ac0bfc2166ac0c30fab91639f2a0b4d3eecaa77e66e901d0951a25aed21', _ended: true, res: [Circular], aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null,

    [Symbol(outHeadersKey)]: [Object] },
 ntick: true,
 timeoutTimer: null,
 response: [Circular],
 originalHost: 'api.binance.com',
 originalHostHeaderName: 'host',
 responseContent: [Circular],
 _destdata: true,
 _ended: true,
 _callbackCalled: true },

toJSON: [Function: responseToJSON], caseless: Caseless { dict: { 'content-type': 'application/json;charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', date: 'Sat, 04 Apr 2020 04:59:08 GMT', server: 'nginx', 'x-mbx-uuid': 'bee0410c-b79f-46e1-bc70-33c84f801457', 'x-mbx-used-weight': '10', 'x-mbx-used-weight-1m': '10', 'strict-transport-security': 'max-age=31536000; includeSubdomains', 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'content-security-policy': "default-src 'self'", 'x-content-security-policy': "default-src 'self'", 'x-webkit-csp': "default-src 'self'", 'cache-control': 'no-cache, no-store, must-revalidate', pragma: 'no-cache', expires: '0', 'x-cache': 'Error from cloudfront', via: '1.1 824b6b17b59323f523bbeab054eeb246.cloudfront.net (CloudFront)', 'x-amz-cf-pop': 'SIN52-C2', 'x-amz-cf-id': 'rNgEzZtgTSvZ5lAc9R_0U5LUpkO3o91gKNACyxtloMR2vrCmET0oGg==' } }, body: '{"code":-1021,"msg":"Timestamp for this request is outside of the recvWindow."}' }

bmino commented 4 years ago

This means you had a request to the binance api that responded in longer than 5 seconds. Your ping seems to be 250ms so I imagine your local clock isn't correctly synced or isn't syncing frequently enough. Google how to do this for your particular operating system

chalitgubkb commented 4 years ago

This means you had a request to the binance api that responded in longer than 5 seconds. Your ping seems to be 250ms so I imagine your local clock isn't correctly synced or isn't syncing frequently enough. Google how to do this for your particular operating system

How can I solve things?

bmino commented 4 years ago

You need to:

1) Sync your local system clock 2) Perhaps increase the rate at which your system clock is synced

leesiongchan commented 4 years ago

$ sudo ntpdate time.windows.com

bmino commented 4 years ago

Closing due to inactivity