Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchURLWithRetry ¶
Types ¶
type CoinMarketCapConfig ¶ added in v0.4.11
type CoinMarketCapFactory ¶ added in v0.4.11
type CoinMarketCapFactory struct {
CoinMarketCapConfig
}
func (*CoinMarketCapFactory) Config ¶ added in v0.4.11
func (m *CoinMarketCapFactory) Config() interface{}
func (*CoinMarketCapFactory) Init ¶ added in v0.4.11
func (m *CoinMarketCapFactory) Init(margin float64) Provider
func (*CoinMarketCapFactory) ValidateConfig ¶ added in v0.4.11
func (m *CoinMarketCapFactory) ValidateConfig() error
type Factory ¶ added in v0.4.11
type Factory interface { Config() interface{} ValidateConfig() error Init(margin float64) Provider }
func NewFactory ¶ added in v0.4.11
type Provider ¶
type Provider interface { // GetPrice returns last known value of token's price. // Note that value is ether-graded (1e18). GetPrice() *big.Int }
Provider loads and calculates mining profit for specified token. The value is is USD per Second per hash.
func NewCMCProvider ¶ added in v0.4.11
func NewCMCProvider(cfg *CoinMarketCapConfig, margin float64) Provider
func NewStaticProvider ¶ added in v0.4.11
func NewStaticProvider(cfg *StaticProviderConfig) Provider
type SourceConfig ¶ added in v0.4.11
type SourceConfig struct {
Factory
}
SourceConfig configure different sources which van be used to obtain price for orders/deals.
func (*SourceConfig) MarshalYAML ¶ added in v0.4.11
func (m *SourceConfig) MarshalYAML() (interface{}, error)
func (*SourceConfig) UnmarshalYAML ¶ added in v0.4.11
func (m *SourceConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type StaticFactory ¶ added in v0.4.11
type StaticFactory struct {
StaticProviderConfig
}
func (*StaticFactory) Config ¶ added in v0.4.11
func (m *StaticFactory) Config() interface{}
func (*StaticFactory) Init ¶ added in v0.4.11
func (m *StaticFactory) Init(Margin float64) Provider
func (*StaticFactory) ValidateConfig ¶ added in v0.4.11
func (m *StaticFactory) ValidateConfig() error
type StaticProviderConfig ¶ added in v0.4.11
type StaticProviderConfig struct {
Price int64 `yaml:"price" required:"true"`
}
Click to show internal directories.
Click to hide internal directories.