Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionGateConfig ¶
type ActionGateway ¶
type ActionGateway struct {
// contains filtered or unexported fields
}
func NewActionGateway ¶
func NewActionGateway(cfg ActionLimitConfig) (*ActionGateway, error)
func NewActionGatewayFromYaml ¶
func NewActionGatewayFromYaml(configDirPath string) (*ActionGateway, error)
func (*ActionGateway) AllowAction ¶
func (a *ActionGateway) AllowAction(tx Store, userAddress string, gatedAction core.GatedAction) error
func (*ActionGateway) AllowAppRegistration ¶
func (v *ActionGateway) AllowAppRegistration(tx Store, userAddress string) error
func (*ActionGateway) GetUserAllowances ¶
func (a *ActionGateway) GetUserAllowances(tx Store, userAddress string) ([]core.ActionAllowance, error)
GetUserAllowances returns user allowance for every gated action.
type ActionLimitConfig ¶
type ActionLimitConfig struct {
LevelStepTokens decimal.Decimal `yaml:"level_step_tokens"`
AppCost decimal.Decimal `yaml:"app_cost"`
ActionGates map[core.GatedAction]ActionGateConfig `yaml:"action_gates"`
}
type Store ¶
type Store interface {
// GetAppCount returns the total number of applications owned by a specific wallet.
GetAppCount(ownerWallet string) (uint64, error)
// GetTotalUserStaked returns the total staked amount for a user across all blockchains.
GetTotalUserStaked(wallet string) (decimal.Decimal, error)
// RecordAction inserts a new action log entry for a user.
RecordAction(wallet string, gatedAction core.GatedAction) error
// GetUserActionCount returns the number of actions matching the given wallet and gated action
// within the specified time window (counting backwards from now).
GetUserActionCount(wallet string, gatedAction core.GatedAction, window time.Duration) (uint64, error)
// GetUserActionCounts returns a map of gated actions to their respective counts for a user within the specified time window.
GetUserActionCounts(userWallet string, window time.Duration) (map[core.GatedAction]uint64, error)
}
Click to show internal directories.
Click to hide internal directories.