deposit

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDepositNotFound = errors.New("external deposit not found")
)

Functions

This section is empty.

Types

type Record

type Record struct {
	Id uint64

	Signature      string
	Destination    string
	Amount         uint64
	UsdMarketValue float64

	Slot              uint64
	ConfirmationState transaction.Confirmation

	CreatedAt time.Time
}

Note: Only captures external deposits at the transaction level

func (*Record) Clone

func (r *Record) Clone() Record

func (*Record) CopyTo

func (r *Record) CopyTo(dst *Record)

func (*Record) Validate

func (r *Record) Validate() error

type Store

type Store interface {
	// Save saves a deposit record
	Save(ctx context.Context, record *Record) error

	// Get gets a deposit record for a signature and account
	Get(ctx context.Context, signature, account string) (*Record, error)

	// GetQuarkAmount gets the total deposited quark amount to an account
	// for finalized transactions
	GetQuarkAmount(ctx context.Context, account string) (uint64, error)

	// GetQuarkAmountBatch is like GetQuarkAmount but for a batch of accounts
	GetQuarkAmountBatch(ctx context.Context, accounts ...string) (map[string]uint64, error)

	// GetUsdAmount gets the total deposited USD amount to an account for finalized
	// transactions
	GetUsdAmount(ctx context.Context, account string) (float64, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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