fees

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MPL-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CalculatorsGen = make(map[string]FeeCalculatorGenerator)
View Source
var FixedFeeCalculatorGen = func(params param.FeeParam) FeeCalculator {
	if defaultParam, ok := params.(*param.FixedFeeParams); ok {
		if defaultParam.Fee <= 0 || defaultParam.FeeFor == types.FeeFree {
			return FreeFeeCalculator()
		} else {
			return FixedFeeCalculator(defaultParam.Fee, defaultParam.FeeFor)
		}
	} else {
		panic("Generator receive unexpected param type")
	}
}
View Source
var Pool pool = newPool()

block level pool

Functions

func RegisterCalculator

func RegisterCalculator(msgType string, feeCalc FeeCalculator)

func UnsetAllCalculators

func UnsetAllCalculators()

Types

type FeeCalculator

type FeeCalculator func(msg types.Msg) types.Fee

func FixedFeeCalculator

func FixedFeeCalculator(amount int64, feeType types.FeeDistributeType) FeeCalculator

func FreeFeeCalculator

func FreeFeeCalculator() FeeCalculator

func GetCalculator

func GetCalculator(msgType string) FeeCalculator

type FeeCalculatorGenerator

type FeeCalculatorGenerator func(params param.FeeParam) FeeCalculator

func GetCalculatorGenerator

func GetCalculatorGenerator(msgType string) FeeCalculatorGenerator

Jump to

Keyboard shortcuts

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