solana

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTransacion added in v1.0.9

func BuildTransacion(ctx context.Context, clientRPC *rpc.Client, signers []solana.PrivateKey, instrs ...solana.Instruction) (*solana.Transaction, error)

func ExecuteInstructions added in v1.0.9

func ExecuteInstructions(
	ctx context.Context,
	clientRPC *rpc.Client,
	signers []solana.PrivateKey,
	instrs ...solana.Instruction,
) (string, error)

func ExecuteInstructionsAndWaitConfirm added in v1.0.9

func ExecuteInstructionsAndWaitConfirm(
	ctx context.Context,
	clientRPC *rpc.Client,
	RPCWs string,
	signers []solana.PrivateKey,
	instrs ...solana.Instruction,
) (string, error)

func GetTokenAccountBalance added in v1.0.7

func GetTokenAccountBalance(url string, pubkey string) (string, float64, error)

func GetTokenAccountsByOwner added in v1.0.7

func GetTokenAccountsByOwner(url string, pubkey string, mint string) (string, float64, error)

func GetTransaction added in v1.0.7

func GetTransaction(c *rpc.Client, signature string, commitmentType *rpc.CommitmentType) (out *rpc.GetTransactionResponse, err error)

Types

type Context added in v1.0.7

type Context struct {
	Slot int `json:"slot"`
}

type Encoding added in v1.0.7

type Encoding struct {
	Encoding string `json:"encoding"`
}

type GetTokenAccountsByOwnerResponse added in v1.0.7

type GetTokenAccountsByOwnerResponse struct {
	Context struct {
		Slot int `json:"slot"`
	} `json:"context"`
	Value []struct {
		Account struct {
			Data struct {
				Parsed struct {
					Info struct {
						IsNative    bool   `json:"isNative"`
						Mint        string `json:"mint"`
						Owner       string `json:"owner"`
						State       string `json:"state"`
						TokenAmount struct {
							Amount         string  `json:"amount"`
							Decimals       int     `json:"decimals"`
							UIAmount       float64 `json:"uiAmount"`
							UIAmountString string  `json:"uiAmountString"`
						} `json:"tokenAmount"`
					} `json:"info"`
					Type string `json:"type"`
				} `json:"parsed"`
				Program string `json:"program"`
				Space   int    `json:"space"`
			} `json:"data"`
			Executable bool   `json:"executable"`
			Lamports   int    `json:"lamports"`
			Owner      string `json:"owner"`
		} `json:"account"`
		Pubkey string `json:"pubkey"`
	} `json:"value"`
}

type MetaResponse added in v1.0.7

type MetaResponse struct {
	Success bool    `json:"success"`
	Message string  `json:"message"`
	Result  *Result `json:"result"`
}

type Mint added in v1.0.7

type Mint struct {
	Mint string `json:"mint"`
}

type PoolInfoResponse added in v1.0.7

type PoolInfoResponse struct {
	RaydiumLiquidityPoolv4 []*RaydiumLiquidityPoolv4 `json:"Raydium_LiquidityPoolv4"`
}

func GetPoolInfo added in v1.0.7

func GetPoolInfo(url string, key string, tokenA string, tokenB string) (*PoolInfoResponse, error)

type RaydiumLiquidityPoolv4 added in v1.0.7

type RaydiumLiquidityPoolv4 struct {
	BaseDecimal     int    `json:"baseDecimal"`
	BaseMint        string `json:"baseMint"`
	BaseVault       string `json:"baseVault"`
	LpMint          string `json:"lpMint"`
	LpVault         string `json:"lpVault"`
	MarketId        string `json:"marketId"`
	MarketProgramId string `json:"marketProgramId"`
	OpenOrders      string `json:"openOrders"`
	QuoteDecimal    int    `json:"quoteDecimal"`
	QuoteMint       string `json:"quoteMint"`
	QuoteVault      string `json:"quoteVault"`
	TargetOrders    string `json:"targetOrders"`
	WithdrawQueue   string `json:"withdrawQueue"`
	Pubkey          string `json:"pubkey"`
}

type Result added in v1.0.7

type Result struct {
	Name     string `json:"name"`
	Symbol   string `json:"symbol"`
	Decimals int    `json:"decimals"`
	Address  string `json:"address"`
}

func GetTokeMeta added in v1.0.7

func GetTokeMeta(url string, mint string, key string) (out *Result, err error)

type TokenBalance added in v1.0.7

type TokenBalance struct {
	Context *Context `json:"context"`
	Value   *Value   `json:"value"`
}

type Value added in v1.0.7

type Value struct {
	Amount         string  `json:"amount"`
	Decimals       int     `json:"decimals"`
	UIAmount       float64 `json:"uiAmount"`
	UIAmountString string  `json:"uiAmountString"`
}

Jump to

Keyboard shortcuts

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