forked from okx/xlayer-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
28 lines (23 loc) · 841 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package gasprice
import (
"math/big"
)
// EstimatorType different gas estimator types.
type EstimatorType string
const (
// DefaultType default gas price from config is set.
DefaultType EstimatorType = "default"
// AllBatchesType calculate average gas used from all batches.
AllBatchesType EstimatorType = "allbatches"
// LastNBatchesType calculate average gas tip from last n batches.
LastNBatchesType EstimatorType = "lastnbatches"
)
// Config for gas price estimator.
type Config struct {
Type EstimatorType `mapstructure:"Type"`
DefaultGasPriceWei uint64 `mapstructure:"DefaultGasPriceWei"`
MaxPrice *big.Int `mapstructure:"MaxPrice"`
IgnorePrice *big.Int `mapstructure:"IgnorePrice"`
CheckBlocks int `mapstructure:"CheckBlocks"`
Percentile int `mapstructure:"Percentile"`
}