johntitus / coinx

Buy, sell, and find the best prices for crypto-currencies from multiple markets.
MIT License
151 stars 37 forks source link

Warn if there is insufficient funds with the exchange during a buy operation #9

Open hasanakyol opened 6 years ago

hasanakyol commented 6 years ago

When trying to buy from any exchange, you get the best possible price - however, if you have insufficient funds at that address you receive an error:

(node:21547) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Invalid order: not enough exchange balance for 0.00837328 ETHBTC at 0.095131 (node:21547) 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.

This should be replaced with: "Insufficient funds at the $exchange exchange, buy from the second most convenient $convenientExchange exchange?"

12 can be invoked