fees

package
v0.0.0-...-1c5c8e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBumpFeeExceedsLimit = errors.New("fee bump exceeds limit")
	ErrBump                = errors.New("fee bump failed")
	ErrConnectivity        = errors.New("transaction propagation issue: transactions are not being mined")
	ErrFeeLimitTooLow      = errors.New("provided fee limit too low")
)

Functions

func AddPercentage

func AddPercentage(value *big.Int, percentage uint16) *big.Int

AddPercentage returns the input value increased by the given percentage.

func ApplyMultiplier

func ApplyMultiplier(feeLimit uint64, multiplier float32) (uint64, error)

func CalculateBumpedFee

func CalculateBumpedFee(
	lggr logger.SugaredLogger,
	currentfeePrice, originalfeePrice, maxFeePriceInput, maxBumpPrice, bumpMin *big.Int,
	bumpPercent uint16,
	toChainUnit feeUnitToChainUnit,
) (*big.Int, error)

CalculateBumpedFee computes the next fee price to attempt as the largest of: - A configured percentage bump (bumpPercent) on top of the baseline price. - A configured fixed amount of Unit (bumpMin) on top of the baseline price. The baseline price is the maximum of the previous fee price attempt and the node's current fee price.

func CalculateFee

func CalculateFee(
	maxFeePrice, defaultPrice, maxFeePriceConfigured *big.Int,
) *big.Int

CalculateFee computes the fee price for a transaction. The fee price is the minimum of: - max fee price specified, default fee price and max fee price for the node.

func IsBumpErr

func IsBumpErr(err error) bool

func MaxBumpedFee

func MaxBumpedFee(originalFeePrice *big.Int, feeBumpPercent uint16, feeBumpUnits *big.Int) *big.Int

MaxBumpedFee returns highest bumped fee price of originalFeePrice bumped by fixed units or percentage.

Types

type Fee

type Fee fmt.Stringer

type Opt

type Opt int

Opt is an option for a gas estimator

const (
	// OptForceRefetch forces the estimator to bust a cache if necessary
	OptForceRefetch Opt = iota
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL