Documentation
¶
Index ¶
- Constants
- func AddressToBytes(address string) ([]byte, error)
- type AddressConverter
- type Chain
- func (c Chain) ChainSelector() uint64
- func (c Chain) CloseBuffers(logger logger.Logger, buffer string) error
- func (c Chain) DeployProgram(logger logger.Logger, programInfo ProgramInfo, isUpgrade bool, ...) (string, error)
- func (c Chain) Family() string
- func (c Chain) GetAccountDataBorshInto(ctx context.Context, pubkey sollib.PublicKey, accountState interface{}) error
- func (c Chain) Name() string
- func (c Chain) String() string
- type ProgramInfo
Constants ¶
View Source
const ( ProgramIDPrefix = "Program Id: " BufferIDPrefix = "Buffer: " SolDefaultCommitment = solrpc.CommitmentConfirmed )
Variables ¶
This section is empty.
Functions ¶
func AddressToBytes ¶ added in v0.44.0
AddressToBytes converts a Solana address string to bytes. Solana addresses are base58-encoded public keys (32 bytes).
Types ¶
type AddressConverter ¶ added in v0.44.0
type AddressConverter struct{}
AddressConverter implements address conversion for Solana chains. This struct implements the AddressConverter strategy interface.
func (AddressConverter) ConvertToBytes ¶ added in v0.44.0
func (s AddressConverter) ConvertToBytes(address string) ([]byte, error)
ConvertToBytes converts a Solana address string to bytes.
func (AddressConverter) Supports ¶ added in v0.44.0
func (s AddressConverter) Supports(family string) bool
Supports returns true if this converter supports the given chain family.
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 *sollib.PrivateKey // SendAndConfim provides a utility function to send a transaction and waits for confirmation. // Options can be passed to modify the transaction such as setting additional signers or // modifying compute unit limits. SendAndConfirm func( ctx context.Context, instructions []sollib.Instruction, opts ...rpcclient.TxModifier, ) error // Legacy: Use SendAndConfirm instead. This function will be removed in the future. // Confirm is a legacy function that sends a transaction and waits for confirmation. Confirm func(instructions []sollib.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 ¶
ChainSelector returns the chain selector of the chain
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) GetAccountDataBorshInto ¶
type ProgramInfo ¶
ProgramInfo contains information about a Solana program.
Click to show internal directories.
Click to hide internal directories.