Versions in this module Expand all Collapse all v0 v0.0.1 Feb 21, 2023 Changes in this version + var ErrContentAlreadyExists = errors.New("content already exists") + var ErrContentMissing = errors.New("content does not exist") + var ErrInsufficientTip = errors.New("insufficient tip") + var ErrInvalidBalance = errors.New("invalid balance") + var ErrWrongOwner = errors.New("wrong owner") + func AddUnlockedBalance(ctx context.Context, db chain.Database, pk crypto.PublicKey, amount uint64, ...) (bool, error) + func DeleteBalance(ctx context.Context, db chain.Database, pk crypto.PublicKey) error + func DeletePermissions(ctx context.Context, db chain.Database, actor crypto.PublicKey, ...) error + func GetBalance(ctx context.Context, db chain.Database, pk crypto.PublicKey) (uint64, uint64, error) + func GetBalanceFromState(ctx context.Context, f ReadState, pk crypto.PublicKey) (uint64, uint64, error) + func GetContent(ctx context.Context, db chain.Database, contentID ids.ID) (crypto.PublicKey, uint64, bool, error) + func GetContentFromState(ctx context.Context, f ReadState, contentID ids.ID) (crypto.PublicKey, uint64, bool, error) + func GetPermissions(ctx context.Context, db chain.Database, actor crypto.PublicKey, ...) (uint8, uint8, error) + func GetTransaction(_ context.Context, db database.KeyValueReader, id ids.ID) (bool, int64, bool, uint64, error) + func IndexContent(ctx context.Context, db chain.Database, contentID ids.ID, pk crypto.PublicKey, ...) error + func LockBalance(ctx context.Context, db chain.Database, pk crypto.PublicKey, amount uint64) error + func PrefixBalanceKey(pk crypto.PublicKey) (k []byte) + func PrefixContentKey(contentID ids.ID) (k []byte) + func PrefixPermissionsKey(actor crypto.PublicKey, signer crypto.PublicKey) (k []byte) + func PrefixTxKey(id ids.ID) (k []byte) + func RewardSearcher(ctx context.Context, db chain.Database, contentID ids.ID, ...) (crypto.PublicKey, error) + func SetBalance(ctx context.Context, db chain.Database, pk crypto.PublicKey, ...) error + func SetContent(ctx context.Context, db chain.Database, contentID ids.ID, ...) error + func SetPermissions(ctx context.Context, db chain.Database, actor crypto.PublicKey, ...) error + func StoreTransaction(_ context.Context, db database.KeyValueWriter, id ids.ID, t int64, ...) error + func SubUnlockedBalance(ctx context.Context, db chain.Database, pk crypto.PublicKey, amount uint64) error + func UnindexContent(ctx context.Context, db chain.Database, contentID ids.ID, pk crypto.PublicKey) error + func UnlockBalance(ctx context.Context, db chain.Database, pk crypto.PublicKey, amount uint64) error + type ReadState func(context.Context, [][]byte) ([][]byte, []error)