Hi I am trying to get a list of orders by hitting this endpoint: https://api.binance.us/api/v3/allOrders
I keep getting the error message that the signature for the request is not valid. Do you know what I am doing wrong? I have included my node js code below. Thank you!
router.get("/transactions", async (req, res) => {
const symbol = "LTCBTC";
const apiSecret = process.env.BINANCE_SECRET_KEY;
const query_string = `timestamp=${new Date().getTime()}`;
const signature = crypto
.createHmac("sha256", apiSecret)
.update(query_string)
.digest("hex");
var config = {
method: "get",
url: `https://api.binance.us/api/v3/allOrders?symbol=${symbol}&recvWindow=5000×tamp=${new Date().getTime()}&signature=${signature}`,
headers: {
"Content-Type": "application/json",
"X-MBX-APIKEY": process.env.BINANCE_API_KEY,
},
};
let result = await axios(config)
.then((res) => {
console.log(res.data);
return res.data;
})
.catch((err) => console.log(err));
res.send({ result });
});