fee

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateDbMaxUpdateSize = payloadMaxSize
)

Variables

This section is empty.

Functions

func CalcFee added in v2.4.9

func CalcFee(gasPrice *big.Int, gas uint64) *big.Int

fee = gas price * gas

func CalcGas added in v2.4.9

func CalcGas(fee, gasPrice *big.Int) *big.Int

gas = fee / gas price

func DisableZeroFee

func DisableZeroFee()

func EnableZeroFee

func EnableZeroFee()

func GasEnabled added in v2.4.9

func GasEnabled(version int32) bool

func GasLimit added in v2.4.9

func GasLimit(version int32, isFeeDelegation bool, txGasLimit uint64, payloadSize int, gasPrice, usedFee, senderBalance, receiverBalance *big.Int) (gasLimit uint64, err error)

func IsZeroFee

func IsZeroFee() bool

func MaxGasLimit

func MaxGasLimit(balance, gasPrice *big.Int) uint64

func MaxPayloadFee added in v2.4.9

func MaxPayloadFee(payloadSize int) *big.Int

func NewZeroFee

func NewZeroFee() *big.Int

func PayloadFee added in v2.4.9

func PayloadFee(payloadSize int) *big.Int

func ReceiptGasUsed added in v2.4.9

func ReceiptGasUsed(version int32, isGovernance bool, txFee, gasPrice *big.Int) uint64

func StateDataFee added in v2.4.9

func StateDataFee(dataSize int64) *big.Int

func TxBaseFee added in v2.4.9

func TxBaseFee(version int32, gasPrice *big.Int, payloadSize int) *big.Int

compute the base fee for a transaction

func TxExecuteFee added in v2.4.9

func TxExecuteFee(version int32, gasPrice *big.Int, usedGas uint64, dbUpdateTotalSize int64) *big.Int

compute the execute fee for a transaction

func TxGas

func TxGas(payloadSize int) uint64

func TxMaxFee added in v2.4.9

func TxMaxFee(version int32, lenPayload int, gasLimit uint64, balance, gasPrice *big.Int) (*big.Int, error)

estimate the max fee for a transaction

Types

This section is empty.

Jump to

Keyboard shortcuts

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