Open justissue opened 3 years ago
All API methods are asynchronous and should be treated as such even if you don't use the returned value. So, you have 3 ways to handle that:
binance.marketBuy('USDTTRY', 1, undefined, () => {});
binance.marketBuy('USDTTRY', 1).then();
async function test() { await binance.marketBuy('USDTTRY', 1); }
I run into this problem when I want to place limit orders. This is my code: `const Binance = require('node-binance-api'); const binance = new Binance().options({ APIKEY: '', APISECRET: '' }); //main code
function test() { binance.marketBuy('USDTTRY', 1); }
test();
I'm facing this problem _(node:2740) UnhandledPromiseRejectionWarning: #<IncomingMessage> (node:2740) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:2740) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code._