fees

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// deprecated: will not support for building instruction
	Instruction_RequestUnitsDeprecated uint8 = iota

	// Request a specific transaction-wide program heap region size in bytes.
	// The value requested must be a multiple of 1024. This new heap region
	// size applies to each program executed in the transaction, including all
	// calls to CPIs.
	// note: uses ag_binary.Varuint32
	Instruction_RequestHeapFrame

	// Set a specific compute unit limit that the transaction is allowed to consume.
	// note: uses ag_binary.Varuint32
	Instruction_SetComputeUnitLimit

	// Set a compute unit price in "micro-lamports" to pay a higher transaction
	// fee for higher transaction prioritization.
	// note: uses ag_binary.Uint64
	Instruction_SetComputeUnitPrice
)

https://github.com/solana-labs/solana/blob/60858d043ca612334de300805d93ea3014e8ab37/sdk/src/compute_budget.rs#L25

View Source
const (
	COMPUTE_BUDGET_PROGRAM = "ComputeBudget111111111111111111111111111111"
)

Variables

This section is empty.

Functions

func CalculateFee

func CalculateFee(base, max, min uint64, count uint) uint64

returns new fee based on number of times bumped

func SetComputeUnitPrice

func SetComputeUnitPrice(tx *solana.Transaction, price ComputeUnitPrice) error

modifies passed in tx to set compute unit price

Types

type ComputeUnitPrice

type ComputeUnitPrice uint64

https://docs.solana.com/developing/programming-model/runtime

func (ComputeUnitPrice) Accounts

func (val ComputeUnitPrice) Accounts() (accounts []*solana.AccountMeta)

No accounts needed

func (ComputeUnitPrice) Data

func (val ComputeUnitPrice) Data() ([]byte, error)

simple encoding into program expected format

func (ComputeUnitPrice) ProgramID

func (val ComputeUnitPrice) ProgramID() solana.PublicKey

returns the compute budget program

type Estimator

type Estimator interface {
	Start(context.Context) error
	Close() error
	BaseComputeUnitPrice() uint64
}

func NewFixedPriceEstimator

func NewFixedPriceEstimator(cfg config.Config) (Estimator, error)

func NewRecentFeeEstimator

func NewRecentFeeEstimator(cfg config.Config) (Estimator, error)

Jump to

Keyboard shortcuts

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