How to use the node.bittrex.api.getbalance function in node

To help you get started, we’ve selected a few node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kevinflo / twitchplayscrypto / app / server.js View on Github external
router.get("/testbuy", function(req, res, next){
    // bittrex.sendCustomRequest("https://bittrex.com/api/v1.1/account/getbalance?apikey="+ secrets.bittrex.API_KEY +"&currency=sc", function(data, err) {
    //     res.json(data);
    // });

    bittrex.getbalance({currency: "BTC"}, function(data, err){
        res.json(data);
    })
})
github kevinflo / twitchplayscrypto / app / server.js View on Github external
console.log("buy worked")
                                var buyString = `{market: ${marketName}, buy: true, sell: false, quantity: ${calculatedBuy.quantity}, rate: ${calculatedBuy.rate}}`;
                                fs.appendFile('logs/orders.txt', buyString, function (err) {
                                  if (err) throw err;
                                  console.log('Saved!');
                                });
                            });
                        }
                    }
                });
            } else {
                notBuyable();
            }
        })
    } else if (winner.action && winner.action === "SELL" && winner.symbol){
        bittrex.getbalance({currency: winner.symbol}, function(data, err){
            console.log("GOT BALANCE", data)

            var marketName = "btc-" + winner.symbol.toLowerCase();
            bittrex.getmarketsummary({market: marketName}, function(marketData,err){
                if (marketData && marketData.result){
                    console.log("md", marketData, marketData.result)
                    var calculatedSell = calculateSell(marketData.result, winner.symbol, marketName, data);

                    if (calculatedSell.quantity && calculatedSell.rate){
                        console.log("EXECUTING SELL", {market: marketName, quantity: calculatedSell.quantity, rate: calculatedSell.rate})
                        bittrex.selllimit({market: marketName, quantity: calculatedSell.quantity, rate: calculatedSell.rate}, function(data, err){
                            console.log("sell worked")
                            var sellString = `{market: ${marketName}, sell: true, buy: false, quantity: ${calculatedSell.quantity}, rate: ${calculatedSell.rate}}`;
                            fs.appendFile('logs/orders.txt', sellString, function (err) {
                              if (err) throw err;
                              console.log('Saved!');
github zjasonshen / BittrexArbitrageBot / arbitrageBot.js View on Github external
const arbitrageTrade = (coinStruct) => {
    bittrex.getbalance({ currency : 'BTC' }, function( data, err ) {
        if (err) {
            
        }
        console.log( data );
      });

};