Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCheckpointNotFound = errors.New("checkpoint not found") ErrStaleCheckpoint = errors.New("checkpoint is stale") )
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
Id uint64
TokenAccount string
Quarks uint64
SlotCheckpoint uint64
LastUpdatedAt time.Time
}
Note: Only supports external balances
type Store ¶
type Store interface {
// SaveCheckpoint saves a balance at a checkpoint. ErrStaleCheckpoint is returned
// if the checkpoint is outdated
SaveCheckpoint(ctx context.Context, record *Record) error
// GetCheckpoint gets a balance checkpoint for a given account. ErrCheckpointNotFound
// is returend if no DB record exists.
GetCheckpoint(ctx context.Context, account string) (*Record, error)
}
Click to show internal directories.
Click to hide internal directories.