computebudget

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Deprecated
	// after feature remove_deprecated_request_unit_ix::id() is activated
	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.
	Instruction_RequestHeapFrame

	// Set a specific compute unit limit that the transaction is allowed to consume.
	Instruction_SetComputeUnitLimit

	// Set a compute unit price in "micro-lamports" to pay a higher transaction
	// fee for higher transaction prioritization.
	Instruction_SetComputeUnitPrice
)
View Source
const MAX_COMPUTE_UNIT_LIMIT = 1400000

Variables

This section is empty.

Functions

This section is empty.

Types

type Instruction

type Instruction struct {
	encodbin.BaseVariant
	TokenProgramID common.Address
}

func (*Instruction) Accounts

func (inst *Instruction) Accounts() (out []*base.AccountMeta)

func (*Instruction) Data

func (inst *Instruction) Data() ([]byte, error)

func (Instruction) MarshalWithEncoder

func (inst Instruction) MarshalWithEncoder(encoder encodbin.Encoder) error

func (*Instruction) ProgramID

func (inst *Instruction) ProgramID() common.Address

func (*Instruction) SetProgramID

func (inst *Instruction) SetProgramID(programID common.Address)

type SetComputeUnitLimit

type SetComputeUnitLimit struct {
	Units uint32
}

func NewSetComputeUnitLimitInstruction

func NewSetComputeUnitLimitInstruction(

	units uint32,
) *SetComputeUnitLimit

NewSetComputeUnitLimitInstruction declares a new SetComputeUnitLimit instruction with the provided parameters and accounts.

func NewSetComputeUnitLimitInstructionBuilder

func NewSetComputeUnitLimitInstructionBuilder() *SetComputeUnitLimit

NewSetComputeUnitLimitInstructionBuilder creates a new `SetComputeUnitLimit` instruction builder.

func (SetComputeUnitLimit) Build

func (inst SetComputeUnitLimit) Build() *Instruction

func (SetComputeUnitLimit) GetAccounts

func (inst SetComputeUnitLimit) GetAccounts() (accounts []base.AccountMeta)

func (SetComputeUnitLimit) MarshalWithEncoder

func (obj SetComputeUnitLimit) MarshalWithEncoder(encoder encodbin.Encoder) (err error)

func (*SetComputeUnitLimit) SetAccounts

func (inst *SetComputeUnitLimit) SetAccounts([]*base.AccountMeta) error

func (*SetComputeUnitLimit) SetUnits

func (inst *SetComputeUnitLimit) SetUnits(units uint32) *SetComputeUnitLimit

Unit limit

func (*SetComputeUnitLimit) Validate

func (inst *SetComputeUnitLimit) Validate() error

func (SetComputeUnitLimit) ValidateAndBuild

func (inst SetComputeUnitLimit) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

type SetComputeUnitPrice

type SetComputeUnitPrice struct {
	MicroLamports uint64
}

func NewSetComputeUnitPriceInstruction

func NewSetComputeUnitPriceInstruction(

	microLamports uint64,
) *SetComputeUnitPrice

NewSetComputeUnitPriceInstruction declares a new SetComputeUnitPrice instruction with the provided parameters and accounts.

func NewSetComputeUnitPriceInstructionBuilder

func NewSetComputeUnitPriceInstructionBuilder() *SetComputeUnitPrice

NewSetComputeUnitPriceInstructionBuilder creates a new `SetComputeUnitPrice` instruction builder.

func (SetComputeUnitPrice) Build

func (inst SetComputeUnitPrice) Build() *Instruction

func (SetComputeUnitPrice) GetAccounts

func (slice SetComputeUnitPrice) GetAccounts() (accounts []*base.AccountMeta)

func (SetComputeUnitPrice) MarshalWithEncoder

func (obj SetComputeUnitPrice) MarshalWithEncoder(encoder *encodbin.Encoder) (err error)

func (*SetComputeUnitPrice) SetAccounts

func (obj *SetComputeUnitPrice) SetAccounts([]*base.AccountMeta) error

func (*SetComputeUnitPrice) SetMicroLamports

func (inst *SetComputeUnitPrice) SetMicroLamports(microLamports uint64) *SetComputeUnitPrice

func (*SetComputeUnitPrice) Validate

func (inst *SetComputeUnitPrice) Validate() error

func (SetComputeUnitPrice) ValidateAndBuild

func (inst SetComputeUnitPrice) ValidateAndBuild() (*Instruction, error)

ValidateAndBuild validates the instruction parameters and accounts; if there is a validation error, it returns the error. Otherwise, it builds and returns the instruction.

Jump to

Keyboard shortcuts

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