impl

package
v0.0.0-...-3968f94 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToInt

func BoolToInt(input bool) int

func Chunk

func Chunk[T any](arr []T, chunkSize int) [][]T

func DeDup

func DeDup[T comparable, TS ~[]T](input TS) []T

func Map

func Map[T any, O any, TS ~[]T](input TS, mapper func(int, T) O) []O

Types

type GetMintRet

type GetMintRet struct {
	TokenAccount      web3.PublicKey
	TokenAccountOwner web3.PublicKey
	Mint              web3.PublicKey
	TokenProgram      web3.PublicKey
}

func GetMint

func GetMint(accountOfToken []web3.PublicKey, connection *web3.Connection, commitment *web3.Commitment) ([]GetMintRet, error)

type ParseTransferRet

type ParseTransferRet struct {
	From             web3.PublicKey `json:"from"`
	To               web3.PublicKey `json:"to"`
	FromOwner        web3.PublicKey `json:"fromOwner"`
	Token            web3.PublicKey `json:"token"`
	TokenType        TokenType      `json:"tokenType"`
	Amount           uint64         `json:"amount"`
	InstructionIndex int            `json:"instructionIndex"`
}

func ParseTransfer

func ParseTransfer(message web3.VersionedMessage, meta *web3.ConfirmedTransactionMeta, signatures []string) (ret []ParseTransferRet, sig string)

func (*ParseTransferRet) IsValid

func (p *ParseTransferRet) IsValid() bool

type TokenType

type TokenType string
const (
	TokenTypeSOL     TokenType = "SOL"
	TokenTypeSPL     TokenType = "SPL"
	TokenTypeSPL2022 TokenType = "SPL2022"
)

Jump to

Keyboard shortcuts

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