jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.57k stars 767 forks source link

spot testnet not working #703

Open kanish-111 opened 3 years ago

kanish-111 commented 3 years ago

i dont know if this is optimized for spot testnet, because i chnaged the base url and stream url my self inside that modules, to "wss://testnet.binance.vision" and "https://testnet.binance.vision/" and then i can get user balances info for my test net account, but i cant place orders in that. if i place a order it gives a big error, for example `<ref *2> IncomingMessage { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: true, ended: true, endEmitted: true, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: true, decoder: null, encoding: null,

}, _events: [Object: null prototype] { end: [ [Function: responseOnEnd], [Function (anonymous)] ], close: [ [Function (anonymous)], [Function (anonymous)] ], data: [Function (anonymous)], error: [Function (anonymous)] }, _eventsCount: 4, _maxListeners: undefined, socket: null, httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [ 'Content-Type', 'application/json;charset=UTF-8', 'Content-Length', '52', 'Connection', 'keep-alive', 'Date', 'Sun, 18 Jul 2021 12:00:45 GMT', 'Server', 'nginx', 'x-mbx-uuid', '15d7529f-d6c0-41e7-9f9c-6fb44270edd3', 'x-mbx-used-weight', '1', 'x-mbx-used-weight-1m', '1', '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 4a3d45392079538c9aa57c1dba9c7b37.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop', 'MAA51-C1', 'X-Amz-Cf-Id', 'cBnLRIxQ9aFr5wxdtm1ee9y5-OqLkOmFQfHymeNifk03Pm3Vxp_Wvg==' ], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 400, statusMessage: 'Bad Request', client: <ref *1> TLSSocket { _tlsOptions: { allowHalfOpen: undefined, pipe: false, secureContext: [SecureContext], isServer: false, requestCert: true, rejectUnauthorized: true, session: undefined, ALPNProtocols: undefined, requestOCSP: undefined, enableTrace: undefined, pskCallback: undefined, highWaterMark: undefined, onread: undefined, signal: undefined }, _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'testnet.binance.vision', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype] { close: [Array], end: [Function: onReadableStreamEnd], newListener: [Function: keylogNewListener], secure: [Function: onConnectSecure], session: [Function (anonymous)], free: [Function: onFree], timeout: [Function: onTimeout], agentRemove: [Function: onRemove] }, _eventsCount: 8, connecting: false, _hadError: false, _parent: null, _host: 'testnet.binance.vision', _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: true, ended: false, endEmitted: false, reading: true, constructed: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: false, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, decoder: null, encoding: null,

},
_maxListeners: undefined,
_writableState: WritableState {
  objectMode: false,
  highWaterMark: 16384,
  finalCalled: false,
  needDrain: false,
  ending: false,
  ended: false,
  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,
  afterWriteTickInfo: null,
  buffered: [],
  bufferedIndex: 0,
  allBuffers: true,
  allNoop: true,
  pendingcb: 0,
  constructed: true,
  prefinished: false,
  errorEmitted: false,
  emitClose: false,
  autoDestroy: true,
  errored: null,
  closed: false,
  closeEmitted: false,
  [Symbol(kOnFinished)]: []
},
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: TLSWrap {
  _parent: [TCP],
  _parentWrap: undefined,
  _secureContext: [SecureContext],
  reading: true,
  onkeylog: [Function: onkeylog],
  onhandshakestart: {},
  onhandshakedone: [Function (anonymous)],
  onocspresponse: [Function: onocspresponse],
  onnewsession: [Function: onnewsessionclient],
  onerror: [Function: onerror],
  [Symbol(owner_symbol)]: [Circular *1]
},
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 6,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: true,
  _last: false,
  chunkedEncoding: false,
  shouldKeepAlive: true,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: true,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  _contentLength: null,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  socket: [Circular *1],
  _header: 'POST /api/v3/order HTTP/1.1\r\n' +
    'User-Agent: Mozilla/4.0 (compatible; Node Binance API)\r\n' +
    'Content-type: application/x-www-form-urlencoded\r\n' +
    'X-MBX-APIKEY: j7rU6E7o4GriW2RHq8AwTCWdU6QUNMpSVB32DrZ8oeaUroF9fhl9XGSung8YOam4\r\n' +
    'host: testnet.binance.vision\r\n' +
    'content-length: 184\r\n' +
    'Connection: keep-alive\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'POST',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  path: '/api/v3/order',
  _ended: true,
  res: [Circular *2],
  aborted: false,
  timeoutCb: null,
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'testnet.binance.vision',
  protocol: 'https:',
  [Symbol(kCapture)]: false,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
timeout: 0,
[Symbol(res)]: TLSWrap {
  _parent: [TCP],
  _parentWrap: undefined,
  _secureContext: [SecureContext],
  reading: true,
  onkeylog: [Function: onkeylog],
  onhandshakestart: {},
  onhandshakedone: [Function (anonymous)],
  onocspresponse: [Function: onocspresponse],
  onnewsession: [Function: onnewsessionclient],
  onerror: [Function: onerror],
  [Symbol(owner_symbol)]: [Circular *1]
},
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 20,
[Symbol(kHandle)]: TLSWrap {
  _parent: [TCP],
  _parentWrap: undefined,
  _secureContext: [SecureContext],
  reading: true,
  onkeylog: [Function: onkeylog],
  onhandshakestart: {},
  onhandshakedone: [Function (anonymous)],
  onocspresponse: [Function: onocspresponse],
  onnewsession: [Function: onnewsessionclient],
  onerror: [Function: onerror],
  [Symbol(owner_symbol)]: [Circular *1]
},
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
  _idleTimeout: -1,
  _idlePrev: null,
  _idleNext: null,
  _idleStart: 2352,
  _onTimeout: null,
  _timerArgs: undefined,
  _repeat: null,
  _destroyed: true,
  [Symbol(refed)]: false,
  [Symbol(kHasPrimitive)]: false,
  [Symbol(asyncId)]: 38,
  [Symbol(triggerId)]: 35
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: {
  rejectUnauthorized: true,
  ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256: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,
  _events: [Object: null prototype],
  _eventsCount: 3,
  _maxListeners: undefined,
  method: 'POST',
  family: false,
  localAddress: false,
  forever: true,
  qsStringifyOptions: [Object],
  headers: [Object],
  callback: [Function (anonymous)],
  readable: true,
  writable: true,
  explicitMethod: true,
  _qs: [Querystring],
  _auth: [Auth],
  _oauth: [OAuth],
  _multipart: [Multipart],
  _redirect: [Redirect],
  _tunnel: [Tunnel],
  setHeader: [Function (anonymous)],
  hasHeader: [Function (anonymous)],
  getHeader: [Function (anonymous)],
  removeHeader: [Function (anonymous)],
  pool: [Object],
  dests: [],
  __isRequestRequest: true,
  _callback: [Function (anonymous)],
  uri: [Url],
  proxy: null,
  tunnel: true,
  setHost: true,
  originalCookieHeader: undefined,
  _disableCookies: true,
  _jar: undefined,
  port: 443,
  host: 'testnet.binance.vision',
  body: 'symbol=BTCUSDT&side=BUY&type=LIMIT&quantity=1&price=1&timeInForce=GTC&timestamp=1626609645090&recvWindow=5000&signature=49fcb6ba9fbc2cdd0336dafc11b2c2460b35bf52e0325a32394e3615eb271420',
  path: null,
  httpModule: [Object],
  agentClass: [Function: Agent],
  agentOptions: [Object],
  agent: [Agent],
  _started: true,
  href: 'https://testnet.binance.vision/api/v3/order',
  secureEndpoint: true,
  _defaultAgent: [Agent],
  keepAlive: true,
  servername: 'testnet.binance.vision',
  _agentKey: 'testnet.binance.vision:443:::::::::::::::::::::',
  encoding: null
},
[Symbol(RequestTimeout)]: undefined

}, _consuming: false, _dumped: false, req: <ref 3> ClientRequest { _events: [Object: null prototype] { response: [Function: bound ], error: [Array], drain: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function], prefinish: [Function: requestOnPrefinish] }, _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: false, chunkedEncoding: false, shouldKeepAlive: true, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: <ref 1> TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'testnet.binance.vision', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 8, connecting: false, _hadError: false, _parent: null, _host: 'testnet.binance.vision', _readableState: [ReadableState], _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: null, _httpMessage: [Circular *3], timeout: 0,

  [Symbol(verified)]: true,
  [Symbol(pendingSession)]: null,
  [Symbol(async_id_symbol)]: 20,
  [Symbol(kHandle)]: [TLSWrap],
  [Symbol(kSetNoDelay)]: false,
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(timeout)]: Timeout {
    _idleTimeout: -1,
    _idlePrev: null,
    _idleNext: null,
    _idleStart: 2352,
    _onTimeout: null,
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: true,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 38,
    [Symbol(triggerId)]: 35
  },
  [Symbol(kBuffer)]: null,
  [Symbol(kBufferCb)]: null,
  [Symbol(kBufferGen)]: null,
  [Symbol(kCapture)]: false,
  [Symbol(kBytesRead)]: 0,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(connect-options)]: [Object],
  [Symbol(RequestTimeout)]: undefined
},
_header: 'POST /api/v3/order HTTP/1.1\r\n' +
  'User-Agent: Mozilla/4.0 (compatible; Node Binance API)\r\n' +
  'Content-type: application/x-www-form-urlencoded\r\n' +
  'X-MBX-APIKEY: j7rU6E7o4GriW2RHq8AwTCWdU6QUNMpSVB32DrZ8oeaUroF9fhl9XGSung8YOam4\r\n' +
  'host: testnet.binance.vision\r\n' +
  'content-length: 184\r\n' +
  'Connection: keep-alive\r\n' +
  '\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
  _events: [Object: null prototype],
  _eventsCount: 2,
  _maxListeners: undefined,
  defaultPort: 443,
  protocol: 'https:',
  options: [Object: null prototype],
  requests: [Object: null prototype] {},
  sockets: [Object: null prototype],
  freeSockets: [Object: null prototype] {},
  keepAliveMsecs: 1000,
  keepAlive: true,
  maxSockets: Infinity,
  maxFreeSockets: 256,
  scheduling: 'lifo',
  maxTotalSockets: Infinity,
  totalSocketCount: 3,
  maxCachedSessions: 100,
  _sessionCache: [Object],
  [Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/api/v3/order',
_ended: true,
res: [Circular *2],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'testnet.binance.vision',
protocol: 'https:',
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
  'user-agent': [Array],
  'content-type': [Array],
  'x-mbx-apikey': [Array],
  host: [Array],
  'content-length': [Array]
}

}, request: <ref 4> Request { _events: [Object: null prototype] { error: [Array], complete: [Function: bound ], pipe: [Function (anonymous)], data: [Function (anonymous)], end: [Function (anonymous)] }, _eventsCount: 5, _maxListeners: undefined, method: 'POST', family: false, localAddress: false, timeout: 5000, forever: true, qsStringifyOptions: { arrayFormat: 'repeat' }, headers: { 'User-Agent': 'Mozilla/4.0 (compatible; Node Binance API)', 'Content-type': 'application/x-www-form-urlencoded', 'X-MBX-APIKEY': 'j7rU6E7o4GriW2RHq8AwTCWdU6QUNMpSVB32DrZ8oeaUroF9fhl9XGSung8YOam4', 'content-length': 184 }, callback: [Function (anonymous)], readable: true, writable: true, explicitMethod: true, _qs: Querystring { request: [Circular 4], lib: [Object], useQuerystring: undefined, parseOptions: {}, stringifyOptions: [Object] }, _auth: Auth { request: [Circular 4], hasAuth: false, sentAuth: false, bearerToken: null, user: null, pass: null }, _oauth: OAuth { request: [Circular 4], params: null }, _multipart: Multipart { request: [Circular 4], boundary: '566b5b0f-c148-4e61-8e79-50c1044ace29', chunked: false, body: null }, _redirect: Redirect { request: [Circular 4], followRedirect: true, followRedirects: true, followAllRedirects: false, followOriginalHttpMethod: false, allowRedirect: [Function (anonymous)], maxRedirects: 10, redirects: [], redirectsFollowed: 0, removeRefererHeader: false }, _tunnel: Tunnel { request: [Circular *4], proxyHeaderWhiteList: [Array], proxyHeaderExclusiveList: [] }, setHeader: [Function (anonymous)], hasHeader: [Function (anonymous)], getHeader: [Function (anonymous)], removeHeader: [Function (anonymous)], pool: { 'https:': [Agent] }, dests: [], __isRequestRequest: true, _callback: [Function (anonymous)], uri: Url { protocol: 'https:', slashes: true, auth: null, host: 'testnet.binance.vision', port: 443, hostname: 'testnet.binance.vision', hash: null, search: null, query: null, pathname: '/api/v3/order', path: '/api/v3/order', href: 'https://testnet.binance.vision/api/v3/order' }, proxy: null, tunnel: true, setHost: true, originalCookieHeader: undefined, _disableCookies: true, _jar: undefined, port: 443, host: 'testnet.binance.vision', body: 'symbol=BTCUSDT&side=BUY&type=LIMIT&quantity=1&price=1&timeInForce=GTC&timestamp=1626609645090&recvWindow=5000&signature=49fcb6ba9fbc2cdd0336dafc11b2c2460b35bf52e0325a32394e3615eb271420', path: '/api/v3/order', httpModule: { Agent: [Function: Agent], globalAgent: [Agent], Server: [Function: Server], createServer: [Function: createServer], get: [Function (anonymous)], request: [Function (anonymous)] }, agentClass: [Function: Agent], agentOptions: { keepAlive: true }, agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: true, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 3, maxCachedSessions: 100, _sessionCache: [Object],

},
_started: true,
href: 'https://testnet.binance.vision/api/v3/order',
req: <ref *3> ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 6,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: true,
  _last: false,
  chunkedEncoding: false,
  shouldKeepAlive: true,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: true,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  _contentLength: null,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  socket: [TLSSocket],
  _header: 'POST /api/v3/order HTTP/1.1\r\n' +
    'User-Agent: Mozilla/4.0 (compatible; Node Binance API)\r\n' +
    'Content-type: application/x-www-form-urlencoded\r\n' +
    'X-MBX-APIKEY: j7rU6E7o4GriW2RHq8AwTCWdU6QUNMpSVB32DrZ8oeaUroF9fhl9XGSung8YOam4\r\n' +
    'host: testnet.binance.vision\r\n' +
    'content-length: 184\r\n' +
    'Connection: keep-alive\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'POST',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  path: '/api/v3/order',
  _ended: true,
  res: [Circular *2],
  aborted: false,
  timeoutCb: null,
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'testnet.binance.vision',
  protocol: 'https:',
  [Symbol(kCapture)]: false,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
ntick: true,
timeoutTimer: null,
response: [Circular *2],
originalHost: 'testnet.binance.vision',
originalHostHeaderName: 'host',
responseContent: [Circular *2],
_destdata: true,
_ended: true,
_callbackCalled: true,
[Symbol(kCapture)]: false

}, toJSON: [Function: responseToJSON], caseless: Caseless { dict: { 'content-type': 'application/json;charset=UTF-8', 'content-length': '52', connection: 'keep-alive', date: 'Sun, 18 Jul 2021 12:00:45 GMT', server: 'nginx', 'x-mbx-uuid': '15d7529f-d6c0-41e7-9f9c-6fb44270edd3', 'x-mbx-used-weight': '1', 'x-mbx-used-weight-1m': '1', '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 4a3d45392079538c9aa57c1dba9c7b37.cloudfront.net (CloudFront)', 'x-amz-cf-pop': 'MAA51-C1', 'x-amz-cf-id': 'cBnLRIxQ9aFr5wxdtm1ee9y5-OqLkOmFQfHymeNifk03Pm3Vxp_Wvg==' } }, body: '{"code":-1013,"msg":"Filter failure: PERCENT_PRICE"}',

'content-type': 'application/json;charset=UTF-8',
'content-length': '52',
connection: 'keep-alive',
date: 'Sun, 18 Jul 2021 12:00:45 GMT',
server: 'nginx',
'x-mbx-uuid': '15d7529f-d6c0-41e7-9f9c-6fb44270edd3',
'x-mbx-used-weight': '1',
'x-mbx-used-weight-1m': '1',
'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 4a3d45392079538c9aa57c1dba9c7b37.cloudfront.net (CloudFront)',
'x-amz-cf-pop': 'MAA51-C1',
'x-amz-cf-id': 'cBnLRIxQ9aFr5wxdtm1ee9y5-OqLkOmFQfHymeNifk03Pm3Vxp_Wvg=='

},

} and i also used this code to get user data in streams but idk if this is working or not function balance_update(data) { console.log("Balance Update"); for ( let obj of data.B ) { let { a:asset, f:available, l:onOrder } = obj; if ( available == "0.00000000" ) continue; console.log(asset+"\tavailable: "+available+" ("+onOrder+" on order)"); } } function execution_update(data) { let { x:executionType, s:symbol, p:price, q:quantity, S:side, o:orderType, i:orderId, X:orderStatus } = data; if ( executionType == "NEW" ) { if ( orderStatus == "REJECTED" ) { console.log("Order Failed! Reason: "+data.r); } console.log(symbol+" "+side+" "+orderType+" ORDER #"+orderId+" ("+orderStatus+")"); console.log("..price: "+price+", quantity: "+quantity); return; } //NEW, CANCELED, REPLACED, REJECTED, TRADE, EXPIRED console.log(symbol+"\t"+side+" "+executionType+" "+orderType+" ORDER #"+orderId); } binance.websockets.userData(balance_update, execution_update);`

i just want this all to work fully on testnet spot or guide me if ive made any mistakes;

@jaggedsoft

emansammut commented 3 years ago

Something wrong with the price it seems, symbol=BTCUSDT&side=BUY&type=LIMIT&quantity=1&price=1

it's like you want to set a limit buy for 1$ for 1 Bitcoin.