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, commonpb.AccountType_RELATIONSHIP, commonpb.AccountType_SWAP, }
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct { Id uint64 OwnerAccount string AuthorityAccount string TokenAccount string MintAccount string AccountType commonpb.AccountType Index uint64 RelationshipTo *string RequiresDepositSync bool DepositsLastSyncedAt time.Time RequiresAutoReturnCheck bool RequiresSwapRetry bool LastSwapRetryAt time.Time CreatedAt time.Time }
func (*Record) IsTimelock ¶ added in v1.3.0
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 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) // GetPrioritizedRequiringSwapRetry gets a set of account info objects where RequiresSwapRetry // is true and records are prioritized by LastSwapRetryAt that are older than minAge GetPrioritizedRequiringSwapRetry(ctx context.Context, minAge time.Duration, limit uint64) ([]*Record, error) // CountRequiringSwapRetry counts the number of account info objects where RequiresSwapRetry // is true CountRequiringSwapRetry(ctx context.Context) (uint64, error) }
Click to show internal directories.
Click to hide internal directories.