Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCommitmentNotFound = errors.New("commitment not found") ErrInvalidCommitment = errors.New("commitment record is invalid") )
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct { Id uint64 DataVersion splitter_token.DataVersion Address string Bump uint8 Pool string PoolBump uint8 RecentRoot string Transcript string Destination string Amount uint64 Vault string VaultBump uint8 Intent string ActionId uint32 Owner string // Has the treasury been repaid for advancing Record.Amount to Record.Destination? // Not to be confused with payments being diverted to this commitment and then // being closed. TreasuryRepaid bool // The commitment vault where repayment for Record.Amount will be diverted to. RepaymentDivertedTo *string State State CreatedAt time.Time }
type Store ¶
type Store interface { // Save saves a commitment account's state Save(ctx context.Context, record *Record) error // GetByAddress gets a commitment account's state by its address GetByAddress(ctx context.Context, address string) (*Record, error) // GetByVault gets a commitment account's state by the vault address GetByVault(ctx context.Context, vault string) (*Record, error) // GetByAction gets a commitment account's state by the action it's involved in GetByAction(ctx context.Context, intentId string, actionId uint32) (*Record, error) // GetAllByState gets all commitment accounts in the provided state GetAllByState(ctx context.Context, state State, cursor query.Cursor, limit uint64, direction query.Ordering) ([]*Record, error) // GetUpgradeableByOwner gets commitment records that are upgradeable and owned // by a provided owner account. GetUpgradeableByOwner(ctx context.Context, owner string, limit uint64) ([]*Record, error) // GetUsedTreasuryPoolDeficit gets the used deficit, in Kin quarks, to a treasury // pool given the associated commitments GetUsedTreasuryPoolDeficit(ctx context.Context, pool string) (uint64, error) // GetTotalTreasuryPoolDeficit gets the total deficit, in Kin quarks, to a treasury // pool given the associated commitments GetTotalTreasuryPoolDeficit(ctx context.Context, pool string) (uint64, error) // CountByState counts the number of commitment records in a given state CountByState(ctx context.Context, state State) (uint64, error) // CountRepaymentsDivertedToVault counts the number of commitments whose repayments // are diverted to the provided vault. CountRepaymentsDivertedToVault(ctx context.Context, vault string) (uint64, error) }
Click to show internal directories.
Click to hide internal directories.