Added static/dynamic fee values/methods for all exchanges.

This commit is contained in:
Adrian Gallagher
2015-02-24 17:53:56 +11:00
parent 660dbb3337
commit 92abe3bd95
10 changed files with 169 additions and 26 deletions

View File

@@ -24,6 +24,7 @@ type ItBit struct {
Name string
Enabled bool
ClientKey, APISecret, UserID string
MakerFee, TakerFee float64
}
type ItBitTicker struct {
@@ -49,6 +50,8 @@ type ItBitTicker struct {
func (i *ItBit) SetDefaults() {
i.Name = "ITBIT"
i.Enabled = true
i.MakerFee = -0.10
i.TakerFee = 0.50
}
func (i *ItBit) GetName() (string) {
@@ -68,6 +71,14 @@ func (i *ItBit) SetAPIKeys(apiKey, apiSecret string) {
i.APISecret = apiSecret
}
func (i *ItBit) GetFee(maker bool) (float64) {
if maker {
return i.MakerFee
} else {
return i.TakerFee
}
}
func (i *ItBit) GetTicker(currency string) (ItBitTicker) {
path := ITBIT_API_URL + "/markets/" + currency + "/ticker"
var itbitTicker ItBitTicker