Привет, я пытаюсь использовать вызов API фьючерсов Binance https://binance-docs.github.io/apidocs/futures/en/#new -order-trade с использованием AWS Lambda и nodejs 12, но получаю ошибку connect ECONNREFUSED 127.0.0.1:443
Вот мой код
module.exports = {
marketOrder: async function(https, req, crypto, apiKey, secretKey, symbol, side, quantity, timestamp) {
return new Promise((resolve, reject) => {
let signature = crypto.createHmac('sha256', secretKey).digest("hex");
const url = `https://fapi.binance.com/fapi/v1/order?symbol=${symbol}&type=MARKET&side=${side}×tamp=${timestamp}&signature=${signature}`;
const options = {
path: url,
method: 'POST',
headers: {
'X-MBX-APIKEY': apiKey,
},
};
const httpRequest = https.request(options, (result) => {
console.log(result)
result.on('data', (data) => {
resolve(JSON.parse(data.toString()));
});
});
httpRequest.write(req.body);
httpRequest.end();
})
}
}