solana

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 15 Imported by: 28

Documentation

Index

Constants

View Source
const (
	ProgramIDPrefix      = "Program Id: "
	BufferIDPrefix       = "Buffer: "
	SolDefaultCommitment = solRpc.CommitmentConfirmed
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Selector uint64

	// RPC client
	Client *solRpc.Client
	URL    string
	WSURL  string
	// TODO: raw private key for now, need to replace with a more secure way
	DeployerKey *solana.PrivateKey
	Confirm     func(instructions []solana.Instruction, opts ...solCommonUtil.TxModifier) error

	// deploy uses the solana CLI which needs a keyfile
	KeypairPath  string
	ProgramsPath string
}

Chain represents a Solana chain.

func (Chain) ChainSelector

func (c Chain) ChainSelector() uint64

ChainSelector returns the chain selector of the chain

func (Chain) CloseBuffers

func (c Chain) CloseBuffers(logger logger.Logger, buffer string) error

func (Chain) DeployProgram

func (c Chain) DeployProgram(logger logger.Logger, programInfo ProgramInfo, isUpgrade bool, overallocate bool) (string, error)

Overallocate should be set when deploying any program that may eventually be owned by timelock Overallocate is mutually exclusive with isUpgrade

func (Chain) Family added in v0.5.1

func (c Chain) Family() string

Family returns the family of the chain

func (Chain) GetAccountDataBorshInto

func (c Chain) GetAccountDataBorshInto(ctx context.Context, pubkey solana.PublicKey, accountState interface{}) error

func (Chain) Name

func (c Chain) Name() string

Name returns the name of the chain

func (Chain) String

func (c Chain) String() string

String returns chain name and selector "<name> (<selector>)"

type ProgramInfo

type ProgramInfo struct {
	Name  string
	Bytes int
}

ProgramInfo contains information about a Solana program.

Jump to

Keyboard shortcuts

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