Documentation ¶
Index ¶
- Constants
- type Connection
- type Ethereum
- func (self *Ethereum) EncodeKyberEnable() (string, error)
- func (self *Ethereum) EncodeMaxGasPrice() (string, error)
- func (self *Ethereum) EncodeRateData(source, dest string, quantity *big.Int) (string, error)
- func (self *Ethereum) EncodeRateDataWrapper(source, dest []string, quantity []*big.Int) (string, error)
- func (self *Ethereum) ExtractEnabled(result string) (bool, error)
- func (self *Ethereum) ExtractMaxGasPrice(result string) (string, error)
- func (self *Ethereum) ExtractRateData(result string, sourceSymbol, destSymbol string) (ethereum.Rate, error)
- func (self *Ethereum) ExtractRateDataWrapper(result string, sourceArr, destAddr []string) ([]ethereum.Rate, error)
- func (self *Ethereum) Gettimestamp(block string, latestBlock string, averageBlockTime int64) (string, error)
- func (self *Ethereum) IsSmallAmount(eventRaw ethereum.EventRaw) (bool, error)
- func (self *Ethereum) ReadEvents(listEventAddr *[]ethereum.EventRaw, typeFetch string, latestBlock string) (*[]ethereum.EventHistory, error)
- func (self *Ethereum) ReadEventsWithBlockNumber(eventRaw *[]ethereum.EventRaw, latestBlock string) (*[]ethereum.EventHistory, error)
- func (self *Ethereum) ReadEventsWithTimeStamp(eventRaw *[]ethereum.EventRaw) (*[]ethereum.EventHistory, error)
- type Fetcher
- func (self *Fetcher) CheckKyberEnable() (bool, error)
- func (self *Fetcher) CheckStatus(listToken, listFailed []ethereum.Token) []ethereum.Token
- func (self *Fetcher) FetchRate7dData() (map[string]*ethereum.Rates, error)
- func (self *Fetcher) FetchUserInfo(address string) (*common.UserInfo, error)
- func (self *Fetcher) GetArrToken() []ethereum.Token
- func (self *Fetcher) GetGasPrice() (*ethereum.GasPrice, error)
- func (self *Fetcher) GetGeneralInfoTokens() map[string]*ethereum.TokenGeneralInfo
- func (self *Fetcher) GetLatestBlock() (string, error)
- func (self *Fetcher) GetListToken() map[string]ethereum.Token
- func (self *Fetcher) GetListTokenAPI() []ethereum.TokenAPI
- func (self *Fetcher) GetMapBadToken() map[string]ethereum.Token
- func (self *Fetcher) GetMapGoodToken() map[string]ethereum.Token
- func (self *Fetcher) GetMaxGasPrice() (string, error)
- func (self *Fetcher) GetNumTokens() int
- func (self *Fetcher) GetRate(currentRate []ethereum.Rate, isNewRate bool, ...) ([]ethereum.Rate, error)
- func (self *Fetcher) GetRateBuy(mapToken map[string]ethereum.Token) ([]ethereum.Rate, error)
- func (self *Fetcher) GetRateUsdEther() (string, error)
- func (self *Fetcher) GetStepRate() ([]ethereum.StepRate, error)
- func (self *Fetcher) GetTokenBySymbol(symbol string) (*ethereum.Token, error)
- func (self *Fetcher) TryUpdateListToken() error
- func (self *Fetcher) UpdateListStatusToken(mapGoodToken, mapBadToken map[string]ethereum.Token)
- func (self *Fetcher) UpdateListToken() error
- type FetcherInterface
- type GasStation
- type HTTPFetcher
- func (self *HTTPFetcher) GetGasPrice() (*ethereum.GasPrice, error)
- func (self *HTTPFetcher) GetListToken() ([]ethereum.Token, error)
- func (self *HTTPFetcher) GetRate7dData() (map[string]*ethereum.Rates, error)
- func (self *HTTPFetcher) GetRateUsdEther() (string, error)
- func (self *HTTPFetcher) GetUserInfo(url string) (*common.UserInfo, error)
- type InfoData
- func (self *InfoData) GetArrToken() []ethereum.Token
- func (self *InfoData) GetListToken() map[string]ethereum.Token
- func (self *InfoData) GetMapBadToken() map[string]ethereum.Token
- func (self *InfoData) GetMapGoodToken() map[string]ethereum.Token
- func (self *InfoData) GetTokenAPI() []ethereum.TokenAPI
- func (self *InfoData) UpdateByBackupToken()
- func (self *InfoData) UpdateListStatusToken(mapGoodToken, mapBadToken map[string]ethereum.Token)
- func (self *InfoData) UpdateListToken(tokens, mapGoodTokens map[string]ethereum.Token, arrToken []ethereum.Token)
- type LogData
- type MarketFetcherInterface
- type RateNetwork
- type RateUSD
- type RateWrapper
- type TokenPrice
Constants ¶
View Source
const ( ETH_TO_WEI = 1000000000000000000 MIN_ETH = 0.1 KEY = "kybersecret" )
View Source
const ( TIME_TO_DELETE = 18000 API_KEY_TRACKER = "jHGlaMKcGn5cCBxQCGwusS4VcnH0C6tN" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Ethereum ¶
type Ethereum struct {
// contains filtered or unexported fields
}
func NewEthereum ¶
func (*Ethereum) EncodeKyberEnable ¶
func (*Ethereum) EncodeMaxGasPrice ¶
func (*Ethereum) EncodeRateData ¶
func (*Ethereum) EncodeRateDataWrapper ¶
func (*Ethereum) ExtractMaxGasPrice ¶
func (*Ethereum) ExtractRateData ¶
func (*Ethereum) ExtractRateDataWrapper ¶
func (*Ethereum) Gettimestamp ¶
func (*Ethereum) IsSmallAmount ¶
func (*Ethereum) ReadEvents ¶
func (*Ethereum) ReadEventsWithBlockNumber ¶
func (*Ethereum) ReadEventsWithTimeStamp ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
func NewFetcher ¶
func (*Fetcher) CheckKyberEnable ¶
func (*Fetcher) CheckStatus ¶ added in v1.1.2
func (*Fetcher) FetchRate7dData ¶
func (*Fetcher) FetchUserInfo ¶
func (*Fetcher) GetArrToken ¶ added in v1.1.2
func (*Fetcher) GetGeneralInfoTokens ¶
func (self *Fetcher) GetGeneralInfoTokens() map[string]*ethereum.TokenGeneralInfo
func (*Fetcher) GetLatestBlock ¶
func (*Fetcher) GetListToken ¶
GetListToken return map token with key is token ID
func (*Fetcher) GetListTokenAPI ¶
api to get config token
func (*Fetcher) GetMapBadToken ¶ added in v1.1.2
func (*Fetcher) GetMapGoodToken ¶ added in v1.1.2
func (*Fetcher) GetMaxGasPrice ¶
func (*Fetcher) GetNumTokens ¶
func (*Fetcher) GetRate ¶
func (self *Fetcher) GetRate(currentRate []ethereum.Rate, isNewRate bool, mapToken map[string]ethereum.Token, fallback bool) ([]ethereum.Rate, error)
GetRate get full rate of list token
func (*Fetcher) GetRateBuy ¶ added in v1.1.2
GetRateBuy return rate fr
func (*Fetcher) GetRateUsdEther ¶
func (*Fetcher) GetTokenBySymbol ¶
func (*Fetcher) TryUpdateListToken ¶
func (*Fetcher) UpdateListStatusToken ¶ added in v1.1.2
func (*Fetcher) UpdateListToken ¶
type FetcherInterface ¶
type FetcherInterface interface { EthCall(string, string) (string, error) GetLatestBlock() (string, error) GetTypeName() string GetRate(string, string) (string, error) }
func NewFetcherIns ¶
func NewFetcherIns(typeName string, endpoint string, apiKey string) (FetcherInterface, error)
type GasStation ¶
type HTTPFetcher ¶
type HTTPFetcher struct {
// contains filtered or unexported fields
}
func NewHTTPFetcher ¶
func NewHTTPFetcher(tradingAPIEndpoint, gasStationEndpoint, apiEndpoint string) *HTTPFetcher
func (*HTTPFetcher) GetGasPrice ¶
func (self *HTTPFetcher) GetGasPrice() (*ethereum.GasPrice, error)
func (*HTTPFetcher) GetListToken ¶
func (self *HTTPFetcher) GetListToken() ([]ethereum.Token, error)
func (*HTTPFetcher) GetRate7dData ¶
func (self *HTTPFetcher) GetRate7dData() (map[string]*ethereum.Rates, error)
func (*HTTPFetcher) GetRateUsdEther ¶
func (self *HTTPFetcher) GetRateUsdEther() (string, error)
GetRateUsdEther get usd from api
func (*HTTPFetcher) GetUserInfo ¶
func (self *HTTPFetcher) GetUserInfo(url string) (*common.UserInfo, error)
type InfoData ¶
type InfoData struct { ApiUsd string `json:"api_usd"` CoinMarket []string `json:"coin_market"` TokenAPI []ethereum.TokenAPI `json:"tokens"` CanDeleteToken []string `json:"can_delete"` Tokens map[string]ethereum.Token BackupTokens map[string]ethereum.Token RateCache []string `json:"rate_cache"` //ServerLog ServerLog `json:"server_logs"` Connections []Connection `json:"connections"` Network string `json:"network"` NetworkAbi string TradeTopic string `json:"trade_topic"` Wapper string `json:"wrapper"` WrapperAbi string EthAdress string EthSymbol string AverageBlockTime int64 `json:"averageBlockTime"` GasStationEndpoint string `json:"gasstation_endpoint"` APIEndpoint string `json:"api_endpoint"` ConfigEndpoint string `json:"config_endpoint"` UserStatsEndpoint string `json:"user_stats_endpoint"` // contains filtered or unexported fields }
func (*InfoData) GetArrToken ¶ added in v1.1.2
func (*InfoData) GetMapBadToken ¶ added in v1.1.2
func (*InfoData) GetMapGoodToken ¶ added in v1.1.2
func (*InfoData) GetTokenAPI ¶
func (*InfoData) UpdateByBackupToken ¶
func (self *InfoData) UpdateByBackupToken()
func (*InfoData) UpdateListStatusToken ¶ added in v1.1.2
type MarketFetcherInterface ¶
type MarketFetcherInterface interface { GetRateUsdEther() (string, error) GetGeneralInfo(string) (*ethereum.TokenGeneralInfo, error) }
func NewMarketFetcherInterface ¶
func NewMarketFetcherInterface() MarketFetcherInterface
type RateNetwork ¶
type RateWrapper ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.