MCPcopy Index your code
hub / github.com/ccxt/node-binance-api / signedRequest

Function signedRequest

deprecated/node-binance-api.js:338–362  ·  view source on GitHub ↗
(url, data = {}, callback, method = 'GET', noDataInSignature = false)

Source from the content-addressed store, hash-verified

336 * @return {undefined}
337 */
338 const signedRequest = (url, data = {}, callback, method = 'GET', noDataInSignature = false) => {
339 requireApiSecret('signedRequest');
340 data.timestamp = new Date().getTime() + Binance.info.timeOffset;
341 if (typeof data.recvWindow === 'undefined') data.recvWindow = Binance.options.recvWindow;
342 let query = method === 'POST' && noDataInSignature ? '' : makeQueryString(data);
343 let signature = crypto.createHmac('sha256', Binance.options.APISECRET).update(query).digest('hex'); // set the HMAC hash header
344 if (method === 'POST') {
345 let opt = reqObjPOST(
346 url,
347 data,
348 method,
349 Binance.options.APIKEY
350 );
351 opt.form.signature = signature;
352 proxyRequest(opt, callback);
353 } else {
354 let opt = reqObj(
355 url + '?' + query + '&signature=' + signature,
356 data,
357 method,
358 Binance.options.APIKEY
359 );
360 proxyRequest(opt, callback);
361 }
362 };
363
364 /**
365 * Create a signed spot order

Callers 5

orderFunction · 0.85
marginOrderFunction · 0.85
universalTransferFunction · 0.85
apiFunction · 0.85

Calls 5

requireApiSecretFunction · 0.85
makeQueryStringFunction · 0.85
reqObjPOSTFunction · 0.85
proxyRequestFunction · 0.85
reqObjFunction · 0.85

Tested by

no test coverage detected