 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  var DefaultConfig = Config{ SuggestBlockWindow: 20, DefaultGas: uint64(unit.Qev), Percentile: 60, FeeHistoryCacheSize: 1024, }
DefaultConfig is the default config
Functions ¶
This section is empty.
Types ¶
type BlockDAO ¶
type BlockDAO interface {
	GetBlockHash(uint64) (hash.Hash256, error)
	GetBlockByHeight(uint64) (*block.Block, error)
	GetReceipts(uint64) ([]*action.Receipt, error)
}
    BlockDAO represents the block data access object
type Config ¶
type Config struct {
	SuggestBlockWindow  int    `yaml:"suggestBlockWindow"`
	DefaultGas          uint64 `yaml:"defaultGas"`
	Percentile          int    `yaml:"Percentile"`
	FeeHistoryCacheSize int    `yaml:"feeHistoryCacheSize"`
}
    Config is the gas station config
type GasStation ¶
type GasStation struct {
	// contains filtered or unexported fields
}
    GasStation provide gas related api
func NewGasStation ¶
func NewGasStation(bc blockchain.Blockchain, dao BlockDAO, cfg Config) *GasStation
NewGasStation creates a new gas station
func (*GasStation) FeeHistory ¶ added in v2.1.1
func (gs *GasStation) FeeHistory(ctx context.Context, blocks, lastBlock uint64, rewardPercentiles []float64) (uint64, [][]*big.Int, []*big.Int, []float64, []*big.Int, []float64, error)
FeeHistory returns fee history over a series of blocks
func (*GasStation) SuggestGasPrice ¶
func (gs *GasStation) SuggestGasPrice() (uint64, error)
SuggestGasPrice suggest gas price
 Click to show internal directories. 
   Click to hide internal directories.