Expose auth validator functionality for wrapper (#416)

* expose auth validator functionality for wrapper

* Add REST validation after keys set, package account types for future syncing

* Add transient error checking for initial creddemtial validation

* fix command types

* Addressed nits from glorious person

* Amalgamate body within error when not between 2xx status, added btcmarket specific auth error check

* nit fix for glorious person

* Format fix

* removed unused code

* check transient first then validate if its an exchange specific authentication error, all others will be disregarded

* Addressed glorious nits

* Addressed glorious nits

* Moved account processing to updateaccountinfo func and added in fetch account info

* Add GRPC Account streaming (NOTE: could not complete until sync item added)

* RM exchange check

* Address xtda nits

* RM comment code

* Fix linter issues

* used most recent protoc version

* lbank linter issues fixed

* Addressed nits and changed len check to range in for loops

* Fixed timeout issue

* thrasher nits addressed

* add string holdings
This commit is contained in:
Ryan O'Hara-Reid
2020-01-31 12:09:24 +11:00
committed by GitHub
parent db23af2ed6
commit a32d16e1f5
75 changed files with 2010 additions and 857 deletions

View File

@@ -2,6 +2,7 @@ package modules
import (
"github.com/thrasher-corp/gocryptotrader/currency"
"github.com/thrasher-corp/gocryptotrader/exchanges/account"
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
"github.com/thrasher-corp/gocryptotrader/exchanges/orderbook"
@@ -27,7 +28,7 @@ type Exchange interface {
QueryOrder(exch, orderid string) (*order.Detail, error)
SubmitOrder(exch string, submit *order.Submit) (*order.SubmitResponse, error)
CancelOrder(exch, orderid string) (bool, error)
AccountInformation(exch string) (*AccountInfo, error)
AccountInformation(exch string) (account.Holdings, error)
DepositAddress(exch string, currencyCode currency.Code) (string, error)
WithdrawalFiatFunds(exch, bankaccountid string, request *withdraw.FiatRequest) (out string, err error)
WithdrawalCryptoFunds(exch string, request *withdraw.CryptoRequest) (out string, err error)
@@ -37,23 +38,3 @@ type Exchange interface {
func SetModuleWrapper(wrapper GCT) {
Wrapper = wrapper
}
// AccountInfo is a Generic type to hold each exchange's holdings in
// all enabled currencies
type AccountInfo struct {
Exchange string
Accounts []Account
}
// Account defines a singular account type with associated currencies
type Account struct {
ID string
Currencies []AccountCurrencyInfo
}
// AccountCurrencyInfo is a sub type to store currency name and value
type AccountCurrencyInfo struct {
CurrencyName currency.Code
TotalValue float64
Hold float64
}