I have been using the Binance Rest API with sub accounts. However, I am unable to get withdraw history. I’m getting a 404 response. Here is an example of my REST call.
var timestamp = Math.floor(Date.now());
var payload = {};
console.log("Timestamp: " + timestamp);
var queryParams = "timestamp=" + timestamp;
const signature = crypto.createHmac('sha256', key.secretKey).update(queryParams).digest('hex')
var options = {
host: host,
port: 443,
path: "/wapi/v3/withdrawHistory?" + queryParams + "&signature=" + signature,
method: "GET",
headers: {
'Content-Type': 'application/json',
'X-MBX-APIKEY': key.apiKey
},
};
var req = https.request(options, function(res) {
console.log("Sent request for account withdraws to Binance Futures. response: " + res.statusCode);
let data = "";
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
callback(JSON.parse(data));
});
});
req.write(JSON.stringify(payload));
req.end();