util

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindInnerInstructions

func FindInnerInstructions(meta *rpc.TransactionMeta, index uint64) []solana.CompiledInstruction

func FindInnerInstructionsFromParsedMeta added in v0.8.9

func FindInnerInstructionsFromParsedMeta(meta *rpc.ParsedTransactionMeta, index uint64) []*rpc.ParsedInstruction

func GetComputeUnitPriceFromHelius added in v0.2.2

func GetComputeUnitPriceFromHelius(
	logger i_logger.ILogger,
	key string,
	accountKeys []string,
) (uint64, error)

func GetFeeInfoFromParsedTx added in v0.8.7

func GetFeeInfoFromParsedTx(meta *rpc.ParsedTransactionMeta, parsedTransaction *rpc.ParsedTransaction) (*type_.FeeInfo, error)

func GetFeeInfoFromTx

func GetFeeInfoFromTx(meta *rpc.TransactionMeta, transaction *solana.Transaction) (*type_.FeeInfo, error)

func GetReserves added in v0.9.9

func GetReserves(
	rpcClient *rpc.Client,
	vault1 solana.PublicKey,
	vault2 solana.PublicKey,
) (
	reserve1_ *type_.TokenAmountInfo,
	reserve2_ *type_.TokenAmountInfo,
	err_ error,
)

Types

type Stack added in v0.4.5

type Stack struct {
	// contains filtered or unexported fields
}

Stack 定义栈结构

func NewStack added in v0.4.5

func NewStack() *Stack

func (*Stack) IsEmpty added in v0.4.5

func (s *Stack) IsEmpty() bool

IsEmpty 判断栈是否为空

func (*Stack) Peek added in v0.4.5

func (s *Stack) Peek() (interface{}, error)

Peek 查看栈顶元素,但不移除它

func (*Stack) Pop added in v0.4.5

func (s *Stack) Pop() (interface{}, error)

Pop 从栈中移除并返回栈顶元素

func (*Stack) Push added in v0.4.5

func (s *Stack) Push(item interface{})

Push 向栈中添加元素

func (*Stack) Size added in v0.4.5

func (s *Stack) Size() int

Size 获取栈的大小

type TransferCheckedInstructionDataType added in v0.9.9

type TransferCheckedInstructionDataType struct {
	Source             solana.PublicKey
	Mint               solana.PublicKey
	Destination        solana.PublicKey
	AmountWithDecimals uint64
	Decimals           uint64
	Authority          solana.PublicKey
}

func DecodeTransferCheckedInstruction added in v0.9.9

func DecodeTransferCheckedInstruction(transferInstruction *rpc.ParsedInstruction) (*TransferCheckedInstructionDataType, error)

func FindNextTwoTransferCheckedDatas added in v1.0.5

func FindNextTwoTransferCheckedDatas(startIndex int, allInstructions []*rpc.ParsedInstruction) ([]*TransferCheckedInstructionDataType, error)

type TransferInstructionDataType added in v0.8.9

type TransferInstructionDataType struct {
	Source             solana.PublicKey
	Destination        solana.PublicKey
	AmountWithDecimals uint64
	Authority          solana.PublicKey
}

func DecodeTransferInstruction added in v0.9.9

func DecodeTransferInstruction(transferInstruction *rpc.ParsedInstruction) (*TransferInstructionDataType, error)

func FindNextTwoTransferDatas added in v1.0.5

func FindNextTwoTransferDatas(startIndex int, allInstructions []*rpc.ParsedInstruction) ([]*TransferInstructionDataType, error)

Jump to

Keyboard shortcuts

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