Open alimohyudin opened 2 years ago
I'm running into the same issue. Seems to work locally, but break once I deploy.
I'm running into the same issue. Seems to work locally, but break once I deploy.
The issue was with got
module kraken.js is using.
I solved this by replacing got
with axios
inside kraken.js of this module.
//const got = require('got');
const axios = require('axios');
...
const rawRequest = async(url, headers, data, timeout) => {
// Set custom User-Agent string
headers['User-Agent'] = 'Kraken Javascript API Client';
const options = { headers, timeout };
Object.assign(options, {
method: 'POST',
body: qs.stringify(data),
});
// const { body } = await got(url, options);
// const response = JSON.parse(body);
let body = await axios.post(url, qs.stringify(data), options);
let myresponse = JSON.stringify(body.data);
// console.log("start");
// console.log(myresponse);
// console.log("end");
const response = JSON.parse(myresponse);
if (response.error && response.error.length) {
const error = response.error
.filter((e) => e.startsWith('E'))
.map((e) => e.substr(1));
if (!error.length) {
throw new Error("Kraken API returned an unknown error");
}
throw new Error(error.join(', '));
}
return response;
};
You can ask me if you get any error, will be happy to help you. :)
Everything works best until I added Binance Api support for my application.
Error I get:
If I remove node-binance-api from code it works just fine.
What should be the patch I need to do to make it work?
Thanks