tokenaccount

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenAccountsNotFound = errors.New("no token accounts found")
)

Functions

func NewCacheUpdater

func NewCacheUpdater(cache Cache, mint ed25519.PublicKey) (*cacheUpdater, error)

Types

type Cache

type Cache interface {
	// Put puts a list of token accounts associated with the given owner.
	Put(ctx context.Context, owner ed25519.PublicKey, tokenAccounts []ed25519.PublicKey) error

	// Get gets an owner's token accounts, if it exists in the cache.
	//
	// ErrTokenAccountsNotFound is returned if no token accounts were cached for the provided owner.
	Get(ctx context.Context, owner ed25519.PublicKey) ([]ed25519.PublicKey, error)

	// Delete removes any cached token accounts for an owner.
	//
	// Delete is idempotent.
	Delete(ctx context.Context, owner ed25519.PublicKey) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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