Documentation
¶
Index ¶
- Variables
- func AwaitConfirmedTransaction(ctx context.Context, cl *rpc.Client, txSig solana.Signature) (*rpc.GetTransactionResult, error)
- func Deploy(ctx context.Context, cl *rpc.Client, composeDir string, program Program) (*rpc.GetTransactionResult, error)
- func FillHash(orderID [32]byte, srcChainID uint64, destChainID uint64, fillDeadline uint32, ...) (common.Hash, error)
- func GetAccountDataInto(ctx context.Context, cl *rpc.Client, address solana.PublicKey, val any) (*rpc.GetAccountInfoResult, error)
- func RandomU96() bin.Uint128
- func Send(ctx context.Context, cl *rpc.Client, opts ...func(*sendOpts)) (solana.Signature, error)
- func SendSimple(ctx context.Context, cl *rpc.Client, privkey solana.PrivateKey, ...) (solana.Signature, error)
- func Start(ctx context.Context, composeDir string, programs ...Program) (*rpc.Client, solana.PrivateKey, func(), error)
- func Stream(ctx context.Context, cl *rpc.Client, req StreamReq, callback StreamCallback) error
- func U128(i *big.Int) (bin.Uint128, error)
- func WithInstructions(instrs ...solana.Instruction) func(*sendOpts)
- func WithPrivateKeys(privkeys ...solana.PrivateKey) func(*sendOpts)
- func WrapRPCError(err error, endpoint string, attrs ...any) error
- type Program
- type StreamCallback
- type StreamReq
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "stable"
Functions ¶
func AwaitConfirmedTransaction ¶
func AwaitConfirmedTransaction(ctx context.Context, cl *rpc.Client, txSig solana.Signature) (*rpc.GetTransactionResult, error)
AwaitConfirmedTransaction waits for a transaction to be confirmed.
func Deploy ¶
func Deploy(ctx context.Context, cl *rpc.Client, composeDir string, program Program) (*rpc.GetTransactionResult, error)
Deploy deploys a program to the localhost compose network using hte default keypair. It returns the confirmed transaction result or an error.
func FillHash ¶
func FillHash( orderID [32]byte, srcChainID uint64, destChainID uint64, fillDeadline uint32, callTarget common.Address, callSelector [4]byte, callValue *big.Int, callParams []byte, expenseSpender common.Address, expenseToken common.Address, expenseAmount *big.Int, ) (common.Hash, error)
FillHash returns the fill hash for the given parameters.
func GetAccountDataInto ¶
func GetAccountDataInto(ctx context.Context, cl *rpc.Client, address solana.PublicKey, val any) (*rpc.GetAccountInfoResult, error)
GetAccountDataInto retrieves account data and decodes it into the provided value. It uses commitment level of "confirmed".
func SendSimple ¶
func Start ¶
func Start(ctx context.Context, composeDir string, programs ...Program) (*rpc.Client, solana.PrivateKey, func(), error)
Start starts a genesis solana node and returns a client, a funded private key and a stop function or an error. The dir parameter is the location of the docker compose.
func WithInstructions ¶
func WithInstructions(instrs ...solana.Instruction) func(*sendOpts)
func WithPrivateKeys ¶
func WithPrivateKeys(privkeys ...solana.PrivateKey) func(*sendOpts)
Types ¶
type Program ¶
Program represents a Solana executable program (smart contract).
func (Program) KeyPairFile ¶
func (Program) MustPrivateKey ¶
func (p Program) MustPrivateKey() solana.PrivateKey
func (Program) MustPublicKey ¶
type StreamCallback ¶
type StreamCallback func(ctx context.Context, sig *rpc.TransactionSignature) error
Click to show internal directories.
Click to hide internal directories.