transaction

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSummary

type BatchSummary struct {
	Best            int
	LostTransaction []int
}

type BlockStatus

type BlockStatus struct {
	ExecutionTime time.Time
	Slot          uint64
	Position      int
	Found         bool
}

type Builder

type Builder func() (string, error)

func MemoBuilder

func MemoBuilder(privateKey solana.PrivateKey, recentBlockHashFn func() (solana.Hash, error)) Builder

MemoBuilder builds a transaction with a simple memo

func SerumBuilder

func SerumBuilder(ctx context.Context, g *provider.GRPCClient, publicKey solana.PublicKey, ooAddress solana.PublicKey, privateKey solana.PrivateKey) Builder

SerumBuilder builds a transaction that's expected to fail (canceling a not found order from Serum). Transactions are submitted with `skipPreflight` however, so it should still be "executed."

type StatusQuerier

type StatusQuerier struct {
	// contains filtered or unexported fields
}

func NewStatusQuerier

func NewStatusQuerier(endpoint string) *StatusQuerier

func NewStatusQuerierWithOpts

func NewStatusQuerierWithOpts(endpoint string, opts StatusQuerierOpts) *StatusQuerier

func (*StatusQuerier) Fetch

func (q *StatusQuerier) Fetch(ctx context.Context, signature solana.Signature) (BlockStatus, error)

Fetch retrieve a transaction's slot in a block and its position within the block. This call blocks until timeout or success.

func (*StatusQuerier) FetchBatch

func (q *StatusQuerier) FetchBatch(ctx context.Context, signatures []solana.Signature) (BatchSummary, []BlockStatus, error)

func (*StatusQuerier) RecentBlockHash

func (q *StatusQuerier) RecentBlockHash(ctx context.Context) (solana.Hash, error)

type StatusQuerierOpts

type StatusQuerierOpts struct {
	FetchAttempts int
	FetchInterval time.Duration
}

type Submitter

type Submitter struct {
	// contains filtered or unexported fields
}

func NewSubmitter

func NewSubmitter(endpoints []string, txBuilder Builder) *Submitter

func NewSubmitterWithOpts

func NewSubmitterWithOpts(endpoints []string, txBuilder Builder, opts SubmitterOpts) *Submitter

func (Submitter) SubmitIteration

func (ts Submitter) SubmitIteration(ctx context.Context) ([]solana.Signature, time.Time, error)

SubmitIteration uses the builder function to construct transactions for each endpoint, then sends all transactions concurrently (to be as fair as possible)

func (Submitter) SubmitIterations

func (ts Submitter) SubmitIterations(ctx context.Context, iterations int) ([][]solana.Signature, []time.Time, error)

SubmitIterations submits n iterations of transactions created by the builder to each of the endpoints and returns all signatures and creation times

type SubmitterOpts

type SubmitterOpts struct {
	SubmissionInterval time.Duration
	SkipPreflight      bool
}

Jump to

Keyboard shortcuts

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