Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountInfoNotFound = errors.New("account info not found") ErrAccountInfoExists = errors.New("account info already exists") ErrInvalidAccountInfo = errors.New("invalid account info") )
View Source
var AllAccountTypes = []commonpb.AccountType{ commonpb.AccountType_PRIMARY, commonpb.AccountType_TEMPORARY_INCOMING, commonpb.AccountType_TEMPORARY_OUTGOING, commonpb.AccountType_BUCKET_1_KIN, commonpb.AccountType_BUCKET_10_KIN, commonpb.AccountType_BUCKET_100_KIN, commonpb.AccountType_BUCKET_1_000_KIN, commonpb.AccountType_BUCKET_10_000_KIN, commonpb.AccountType_BUCKET_100_000_KIN, commonpb.AccountType_BUCKET_1_000_000_KIN, commonpb.AccountType_REMOTE_SEND_GIFT_CARD, }
todo: RELATIONSHIP explicitly left out, which requires a refactor of GetLatestByOwnerAddress. This is fine, because these account types are not part of any payment flows atm.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Store ¶
type Store interface { // Put creates a new account info object Put(ctx context.Context, record *Record) error // Update updates an account info object Update(ctx context.Context, record *Record) error // GetByTokenAddress finds the record for a given token account address GetByTokenAddress(ctx context.Context, address string) (*Record, error) // GetByAuthorityAddress finds the record for a given authority account address GetByAuthorityAddress(ctx context.Context, address string) (*Record, error) // GetLatestByOwnerAddress gets the latest accounts for an owner // // todo: This doesn't handle relationship accounts, and can't because of the return // structure. It's not a big deal right now, since all usages of latest accounts // are for those accounts possibly containing Kin, and relationship accounts have // no support for that atm. GetLatestByOwnerAddress(ctx context.Context, address string) (map[commonpb.AccountType]*Record, error) // GetLatestByOwnerAddressAndType gets the latest account for an owner and account type GetLatestByOwnerAddressAndType(ctx context.Context, address string, accountType commonpb.AccountType) (*Record, error) // GetRelationshipByOwnerAddress gets a relationship account for a given owner. // // Note: Index is always zero, so there's no concept of a "latest" GetRelationshipByOwnerAddress(ctx context.Context, address, relationshipTo string) (*Record, error) // GetPrioritizedRequiringDepositSync gets a set of account info objects where // RequiresDepositSync is true that's prioritized by DepositsLastSyncedAt GetPrioritizedRequiringDepositSync(ctx context.Context, limit uint64) ([]*Record, error) // CountRequiringDepositSync counts the number of account info objects where // RequiresDepositSync is true CountRequiringDepositSync(ctx context.Context) (uint64, error) // GetPrioritizedRequiringAutoReturnCheck gets a set of account info objects where // RequiresAutoReturnCheck is true and older than minAge that's prioritized by CreatedAt GetPrioritizedRequiringAutoReturnCheck(ctx context.Context, minAge time.Duration, limit uint64) ([]*Record, error) // CountRequiringAutoReturnCheck counts the number of account info objects where // RequiresAutoReturnCheck is true CountRequiringAutoReturnCheck(ctx context.Context) (uint64, error) }
Click to show internal directories.
Click to hide internal directories.