solana

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Failed  = -1
	Pending = 1
	Success = 2
)

Variables

This section is empty.

Functions

func FromLamports

func FromLamports(v uint64) *big.Float

func GetBalance

func GetBalance(addr string, rpcUrl string) (*big.Float, error)

func GetNFTAddrFromTransaction

func GetNFTAddrFromTransaction(signature, rpcUrl string) (int, string, error)

func GetSolPriceFromMoralis

func GetSolPriceFromMoralis(key string) (float64, error)

func GetSolPriceMobula

func GetSolPriceMobula(key string) (float64, error)

func GetTransactionInfo

func GetTransactionInfo(signature string, rpcUrl string) (state int, fromVal string, toVal string, amountVal uint64, err error)

func GetTransactionList

func GetTransactionList(addr string, rpcUrl string) (rpc.GetConfirmedSignaturesForAddress2Result, error)

func GetTransactionSate

func GetTransactionSate(sig string, rpcUrl string) (bool, error)

func ToLamports

func ToLamports(v *big.Float) uint64

Types

type Message

type Message struct {
	AccountKeys []string `json:"accountKeys"`
}

type MoralisPriceResponse

type MoralisPriceResponse struct {
	UsdPrice float64 `json:"usdPrice"`
}

type SOLWallet

type SOLWallet struct {
	PublicKey  string
	PrivateKey string
}

func CreateWallet

func CreateWallet() *SOLWallet

func ImportFromPrivateKey

func ImportFromPrivateKey(filePath string) (*SOLWallet, error)

func (*SOLWallet) GetAirdrop

func (w *SOLWallet) GetAirdrop(sol float64, rpcUrl string) (string, error)

func (*SOLWallet) TransferSPLToken

func (w *SOLWallet) TransferSPLToken(tokenSource string, to string, amount uint64, rpcUrl string) (string, error)

func (*SOLWallet) TransferToWaitConfirm

func (w *SOLWallet) TransferToWaitConfirm(to string, amount uint64, rpcUrl, wsUrl string) (string, error)

TransferToWaitConfirm transfer SOL to another account and wait for confirmation amount: in lamports (1 SOL = 1000000000 lamports)

func (*SOLWallet) TransferToWithoutConfirm

func (w *SOLWallet) TransferToWithoutConfirm(to string, amount uint64, rpcUrl string) (string, error)

type TransactionModel

type TransactionModel struct {
	Signature string  `json:"signature"`
	Message   Message `json:"message"`
}

Jump to

Keyboard shortcuts

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