solana

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 12 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 GetMCMConfigPDA

func GetMCMConfigPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey

GetMCMConfigPDA returns the PDA for the MCMS config

func GetMCMExpiringRootAndOpCountPDA

func GetMCMExpiringRootAndOpCountPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey

GetMCMExpiringRootAndOpCountPDA returns the PDA for the MCMS expiring root and op count

func GetMCMRootMetadataPDA

func GetMCMRootMetadataPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey

GetMCMRootMetadataPDA returns the PDA for the MCMS root metadata

func GetMCMSignerPDA

func GetMCMSignerPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey

GetMCMSignerPDA returns the PDA for the MCMS signer

func GetTimelockConfigPDA

func GetTimelockConfigPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey

GetTimelockConfigPDA returns the PDA for the Timelock config

func GetTimelockSignerPDA

func GetTimelockSignerPDA(programID solana.PublicKey, seed PDASeed) solana.PublicKey

GetTimelockSignerPDA returns the PDA for the Timelock signer

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) 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

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