]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/blobdiff - markets/poloniex.go
Handle poloniex ip restriction.
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git] / markets / poloniex.go
index 5e1ec6473f3eb6ce3adfef00e69cbda1c269bb4d..34ebb7eaf5e296bd9d550118d18428b18ccd4155 100644 (file)
@@ -13,6 +13,7 @@ var (
        ErrorFlagCounter        utils.Counter = 0
        CurrencyPairNotInTicker               = utils.InitFlag(&ErrorFlagCounter, "CurrencyPairNotInTicker")
        InvalidCredentials                    = utils.InitFlag(&ErrorFlagCounter, "InvalidCredentials")
+       IPRestricted                          = utils.InitFlag(&ErrorFlagCounter, "IPRestricted")
 )
 
 func poloniexInvalidCredentialsError(err error) bool {
@@ -22,6 +23,13 @@ func poloniexInvalidCredentialsError(err error) bool {
        return strings.Contains(err.Error(), "Invalid API key/secret pair")
 }
 
+func poloniexRestrictedIPError(err error) bool {
+       if err == nil {
+               return false
+       }
+       return strings.Contains(err.Error(), "Permission denied")
+}
+
 type CurrencyPair struct {
        Name string
        Rate decimal.Decimal