Documentation
¶
Index ¶
- Constants
- func Average(samples []float64) (average float64)
- func AvgDistances(samples []float64) (distSlice []float64)
- func ContainsAddress(addresses []common.Address, address common.Address) (contains bool)
- func GetBalanceOf(tokenAddress common.Address, walletAddress common.Address, ...) (*big.Int, error)
- func GetPath(configPath string, exchange string) string
- func GetPriceFromDiaAPI(address string, blockchain string) (float64, error)
- func GetRequest(url string) ([]byte, int, error)
- func Getenv(key, fallback string) string
- func MakeEthClient(mainNode string, backupNode string) (conn *ethclient.Client, err error)
- func Median(samples []float64) (median float64)
- func Norm(samples []float64) float64
- func RemoveOutliers(samples []float64, threshold float64) (cleanedSamples []float64, indices []int)
- type TokenCaller
Constants ¶
const ( BINANCESMARTCHAIN = "BinanceSmartChain" BITCOIN = "Bitcoin" ETHEREUM = "Ethereum" )
Variables ¶
This section is empty.
Functions ¶
func AvgDistances ¶
AvgDistances returns a slice. The i-th entry of @distSlice is the average distance from all other entries normalized by the 2-norm of @samples.
func ContainsAddress ¶
func GetBalanceOf ¶
func GetPriceFromDiaAPI ¶
func GetRequest ¶
GetRequest performs a get request on @url and returns the response body as a slice of byte data.
func MakeEthClient ¶ added in v0.1.10
func RemoveOutliers ¶
RemoveOutliers removes outliers from @samples which have an average distance to the rest larger than @threshold. Distance is normalized by the 2-norm. The removal process is iteratively and returns as soon as no distance is larger than threshold or len(@cleanedSamples)=2. @indices is the slice of indices which were originally in samples, so @samples[@indices]=@cleanedSamples.
Types ¶
type TokenCaller ¶
type TokenCaller struct {
Contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
TokenCaller is an auto generated read-only Go binding around an Ethereum contract.
func NewTokenCaller ¶
func NewTokenCaller(address common.Address, caller bind.ContractCaller) (*TokenCaller, error)
NewTokenCaller creates a new read-only instance of token, bound to a specific deployed contract.