solana

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeAddressWithSeed

func EncodeAddressWithSeed(programID solana.PublicKey, seed PDASeed) string

func FundFromAddressIxs

func FundFromAddressIxs(from solana.PublicKey, recipients []solana.PublicKey, amount uint64) ([]solana.Instruction, error)

FundFromAddressIxs builds system program transfer instructions that send lamports from the given sender to each recipient. It does not submit or confirm a transaction.

func FundFromDeployerKey

func FundFromDeployerKey(solChain cldf_solana.Chain, recipients []solana.PublicKey, amount uint64) error

FundFromDeployerKey transfers SOL from the deployer to each recipient and waits for confirmations.

func MaybeLoadMCMSWithTimelockState

func MaybeLoadMCMSWithTimelockState(env cldf.Environment, chainSelectors []uint64) (map[uint64]*MCMSWithTimelockState, error)

MaybeLoadMCMSWithTimelockState loads MCMSWithTimelockState for each provided chain selector from the environment's Solana chains and ExistingAddresses (address book).

Types

type MCMSWithTimelockPrograms

type MCMSWithTimelockPrograms struct {
	McmProgram                       solana.PublicKey
	ProposerMcmSeed                  PDASeed
	CancellerMcmSeed                 PDASeed
	BypasserMcmSeed                  PDASeed
	TimelockProgram                  solana.PublicKey
	TimelockSeed                     PDASeed
	AccessControllerProgram          solana.PublicKey
	ProposerAccessControllerAccount  solana.PublicKey
	ExecutorAccessControllerAccount  solana.PublicKey
	CancellerAccessControllerAccount solana.PublicKey
	BypasserAccessControllerAccount  solana.PublicKey
}

MCMSWithTimelockPrograms holds the Solana public keys and seeds for the MCM, AccessController and Timelock programs. It is public for use in product specific packages.

func (*MCMSWithTimelockPrograms) GenerateView

func (*MCMSWithTimelockPrograms) GetStateFromType

func (s *MCMSWithTimelockPrograms) GetStateFromType(programType cldf.ContractType) (solana.PublicKey, PDASeed, error)

func (*MCMSWithTimelockPrograms) RoleAccount

func (*MCMSWithTimelockPrograms) SetState

func (s *MCMSWithTimelockPrograms) SetState(contractType cldf.ContractType, program solana.PublicKey, seed PDASeed) error

func (*MCMSWithTimelockPrograms) Validate

func (s *MCMSWithTimelockPrograms) Validate() error

Validate checks that all fields are non-nil, ensuring it's ready for use generating views or interactions.

type MCMSWithTimelockState

type MCMSWithTimelockState struct {
	*MCMSWithTimelockPrograms
}

MCMSWithTimelockState holds the Go bindings for a MCMSWithTimelock contract deployment. It is public for use in product specific packages.

func GetState

func GetState(env cldf.Environment, selector uint64) (*MCMSWithTimelockState, error)

GetState loads the MCMSWithTimelockState from the environment

func MaybeLoadMCMSWithTimelockChainState

func MaybeLoadMCMSWithTimelockChainState(chain cldf_solana.Chain, addresses map[string]cldf.TypeAndVersion) (*MCMSWithTimelockState, error)

MaybeLoadMCMSWithTimelockChainState looks for the addresses corresponding to contracts deployed with DeployMCMSWithTimelock and loads them into a MCMSWithTimelockStateSolana struct. If none of the contracts are found, the state struct will be nil. An error indicates: - Found but was unable to load a contract - It only found part of the bundle of contracts - If found more than one instance of a contract (we expect one bundle in the given addresses)

func MaybeLoadMCMSWithTimelockChainStateV2

func MaybeLoadMCMSWithTimelockChainStateV2(refs []datastore.AddressRef) (*MCMSWithTimelockState, error)

Loads MCMSSolanaState from Datastore address refs

func (MCMSWithTimelockState) TimelockPrograms

TimelockPrograms implements cldfproposalutils.SolanaMCMSWithTimelock for MCMS timelock proposal helpers.

type PDASeed

type PDASeed [32]byte

func DecodeAddressWithSeed

func DecodeAddressWithSeed(address string) (solana.PublicKey, PDASeed, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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