diff --git a/bitfinexhttp.go b/bitfinexhttp.go index d8747122..833a10a3 100644 --- a/bitfinexhttp.go +++ b/bitfinexhttp.go @@ -145,6 +145,7 @@ type Bitfinex struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration APIKey, APISecret string Ticker BitfinexTicker @@ -161,6 +162,7 @@ func (b *Bitfinex) SetDefaults() { b.Name = "Bitfinex" b.Enabled = true b.Verbose = false + b.Websocket = false b.PollingDelay = 10 } diff --git a/bitstamphttp.go b/bitstamphttp.go index 75023867..73a042bd 100644 --- a/bitstamphttp.go +++ b/bitstamphttp.go @@ -35,6 +35,7 @@ type Bitstamp struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration ClientID, APIKey, APISecret string Ticker BitstampTicker @@ -85,6 +86,7 @@ func (b *Bitstamp) SetDefaults() { b.Name = "Bitstamp" b.Enabled = true b.Verbose = false + b.Websocket = false b.PollingDelay = 10 } diff --git a/btcchinahttp.go b/btcchinahttp.go index 22c15ebf..463bd667 100644 --- a/btcchinahttp.go +++ b/btcchinahttp.go @@ -42,6 +42,7 @@ type BTCChina struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration APISecret, APIKey string Fee float64 @@ -172,6 +173,7 @@ func (b *BTCChina) SetDefaults() { b.Enabled = true b.Fee = 0 b.Verbose = false + b.Websocket = false b.PollingDelay = 10 } diff --git a/btcehttp.go b/btcehttp.go index 182451f5..dec5b5e1 100644 --- a/btcehttp.go +++ b/btcehttp.go @@ -30,6 +30,7 @@ type BTCE struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration APIKey, APISecret string Fee float64 @@ -65,6 +66,7 @@ func (b *BTCE) SetDefaults() { b.Enabled = true b.Fee = 0.2 b.Verbose = false + b.Websocket = false b.PollingDelay = 10 } diff --git a/btcmarkets.go b/btcmarkets.go index 92f71ed5..92bcf9f9 100644 --- a/btcmarkets.go +++ b/btcmarkets.go @@ -17,6 +17,7 @@ type BTCMarkets struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration Fee float64 APIKey, APISecret string @@ -36,6 +37,7 @@ func (b *BTCMarkets) SetDefaults() { b.Enabled = true b.Fee = 0.85 b.Verbose = false + b.Websocket = false b.PollingDelay = 10 } diff --git a/coinbase.go b/coinbase.go index c6d7b0ac..4052751c 100644 --- a/coinbase.go +++ b/coinbase.go @@ -24,6 +24,7 @@ type Coinbase struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration Password, APIKey, APISecret string TakerFee, MakerFee float64 @@ -89,6 +90,7 @@ func (c *Coinbase) SetDefaults() { c.TakerFee = 0.25 c.MakerFee = 0 c.Verbose = false + c.Websocket = false c.PollingDelay = 10 } diff --git a/config.go b/config.go index f8c27486..6be7db74 100644 --- a/config.go +++ b/config.go @@ -28,6 +28,7 @@ type Exchanges struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration APIKey string APISecret string diff --git a/config_example.json b/config_example.json index bf447b38..a66c7c12 100644 --- a/config_example.json +++ b/config_example.json @@ -18,6 +18,7 @@ "BaseCurrencies": "USD", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -29,6 +30,7 @@ "BaseCurrencies": "USD", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -39,6 +41,7 @@ "BaseCurrencies": "CNY", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -49,6 +52,7 @@ "BaseCurrencies": "USD,RUB,EUR,CNY,GBP", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -59,6 +63,7 @@ "BaseCurrencies": "AUD", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -70,6 +75,7 @@ "BaseCurrencies": "USD", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -81,6 +87,7 @@ "BaseCurrencies": "USD", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -91,6 +98,7 @@ "BaseCurrencies": "CNY", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -101,6 +109,7 @@ "BaseCurrencies": "USD,SGD,EUR", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -111,6 +120,7 @@ "BaseCurrencies": "EUR,USD,GBP,JPY", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -121,6 +131,7 @@ "BaseCurrencies": "CNY", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -131,6 +142,7 @@ "BaseCurrencies": "CNY", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 }, { @@ -141,6 +153,7 @@ "BaseCurrencies": "USD", "Enabled": true, "Verbose": false, + "Websocket": false, "PollingDelay": 10 } ] diff --git a/cryptsyhttp.go b/cryptsyhttp.go index f19d433c..e8d0a02a 100644 --- a/cryptsyhttp.go +++ b/cryptsyhttp.go @@ -34,6 +34,7 @@ type Cryptsy struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration APIKey, APISecret string TakerFee, MakerFee float64 @@ -127,6 +128,7 @@ func (c *Cryptsy) SetDefaults() { c.Name = "Cryptsy" c.Enabled = true c.Verbose = false + c.Websocket = false c.TakerFee = 0.33 c.MakerFee = 0.33 c.Verbose = false diff --git a/huobihttp.go b/huobihttp.go index c262f6f9..d6be3d53 100644 --- a/huobihttp.go +++ b/huobihttp.go @@ -18,6 +18,7 @@ type HUOBI struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration AccessKey, SecretKey string Fee float64 @@ -42,6 +43,7 @@ func (h *HUOBI) SetDefaults() { h.Enabled = true h.Fee = 0 h.Verbose = false + h.Websocket = false h.PollingDelay = 10 } diff --git a/itbithttp.go b/itbithttp.go index 666e19e9..1b39d2dc 100644 --- a/itbithttp.go +++ b/itbithttp.go @@ -19,6 +19,7 @@ type ItBit struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration ClientKey, APISecret, UserID string MakerFee, TakerFee float64 @@ -50,6 +51,7 @@ func (i *ItBit) SetDefaults() { i.MakerFee = -0.10 i.TakerFee = 0.50 i.Verbose = false + i.Websocket = false i.PollingDelay = 10 } diff --git a/kraken.go b/kraken.go index 949a2c4a..1e22214a 100644 --- a/kraken.go +++ b/kraken.go @@ -41,6 +41,7 @@ type Kraken struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration ClientKey, APISecret string FiatFee, CryptoFee float64 @@ -57,6 +58,7 @@ func (k *Kraken) SetDefaults() { k.FiatFee = 0.35 k.CryptoFee = 0.10 k.Verbose = false + k.Websocket = false k.PollingDelay = 10 } diff --git a/lakebtchttp.go b/lakebtchttp.go index 8621c08e..24f32982 100644 --- a/lakebtchttp.go +++ b/lakebtchttp.go @@ -28,6 +28,7 @@ type LakeBTC struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration Email, APISecret string TakerFee, MakerFee float64 @@ -53,6 +54,7 @@ func (l *LakeBTC) SetDefaults() { l.TakerFee = 0.2 l.MakerFee = 0.15 l.Verbose = false + l.Websocket = false l.PollingDelay = 10 } diff --git a/main.go b/main.go index b522cdb5..a09514ac 100644 --- a/main.go +++ b/main.go @@ -109,6 +109,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.btcchina.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.btcchina.PollingDelay = exch.PollingDelay + bot.exchange.btcchina.Websocket = exch.Websocket go bot.exchange.btcchina.Run() if exch.Verbose { @@ -127,6 +128,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.bitstamp.SetAPIKeys(exch.ClientID, exch.APIKey, exch.APISecret) bot.exchange.bitstamp.PollingDelay = exch.PollingDelay + bot.exchange.bitstamp.Websocket = exch.Websocket go bot.exchange.bitstamp.Run() if exch.Verbose { @@ -144,6 +146,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.bitfinex.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.bitfinex.PollingDelay = exch.PollingDelay + bot.exchange.bitfinex.Websocket = exch.Websocket go bot.exchange.bitfinex.Run() if exch.Verbose { @@ -161,6 +164,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.btce.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.btce.PollingDelay = exch.PollingDelay + bot.exchange.btce.Websocket = exch.Websocket go bot.exchange.btce.Run() if exch.Verbose { @@ -178,6 +182,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.btcmarkets.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.btcmarkets.PollingDelay = exch.PollingDelay + bot.exchange.btcmarkets.Websocket = exch.Websocket go bot.exchange.btcmarkets.Run() if exch.Verbose { @@ -195,6 +200,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.coinbase.SetAPIKeys(exch.ClientID, exch.APIKey, exch.APISecret) bot.exchange.coinbase.PollingDelay = exch.PollingDelay + bot.exchange.coinbase.Websocket = exch.Websocket go bot.exchange.coinbase.Run() if exch.Verbose { @@ -212,6 +218,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.cryptsy.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.cryptsy.PollingDelay = exch.PollingDelay + bot.exchange.cryptsy.Websocket = exch.Websocket go bot.exchange.cryptsy.Run() if exch.Verbose { @@ -229,6 +236,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.okcoinChina.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.okcoinChina.PollingDelay = exch.PollingDelay + bot.exchange.okcoinChina.Websocket = exch.Websocket go bot.exchange.okcoinChina.Run() if exch.Verbose { @@ -246,6 +254,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.okcoinIntl.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.okcoinIntl.PollingDelay = exch.PollingDelay + bot.exchange.okcoinIntl.Websocket = exch.Websocket go bot.exchange.okcoinIntl.Run() if exch.Verbose { @@ -263,6 +272,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.itbit.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.itbit.PollingDelay = exch.PollingDelay + bot.exchange.itbit.Websocket = exch.Websocket go bot.exchange.itbit.Run() if exch.Verbose { @@ -280,6 +290,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.kraken.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.kraken.PollingDelay = exch.PollingDelay + bot.exchange.kraken.Websocket = exch.Websocket go bot.exchange.kraken.Run() if exch.Verbose { @@ -297,6 +308,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.lakebtc.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.lakebtc.PollingDelay = exch.PollingDelay + bot.exchange.lakebtc.Websocket = exch.Websocket go bot.exchange.lakebtc.Run() if exch.Verbose { @@ -314,6 +326,7 @@ func main() { log.Printf("%s enabled.\n", exch.Name) bot.exchange.huobi.SetAPIKeys(exch.APIKey, exch.APISecret) bot.exchange.huobi.PollingDelay = exch.PollingDelay + bot.exchange.huobi.Websocket = exch.Websocket go bot.exchange.huobi.Run() if exch.Verbose { diff --git a/okcoinhttp.go b/okcoinhttp.go index 16da9e95..59d9aa4c 100644 --- a/okcoinhttp.go +++ b/okcoinhttp.go @@ -19,6 +19,7 @@ type OKCoin struct { Name string Enabled bool Verbose bool + Websocket bool PollingDelay time.Duration APIUrl, PartnerID, SecretKey string TakerFee, MakerFee float64 @@ -61,6 +62,7 @@ func (o *OKCoin) SetDefaults() { } o.Enabled = true o.Verbose = false + o.Websocket = false o.PollingDelay = 10 }