Documentation ¶
Index ¶
- func GetAirdropDurationForAction(action types.Action) int64
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochInfo epochstypes.EpochInfo)
- func (h Hooks) AfterLiquidStake(ctx sdk.Context, addr sdk.AccAddress)
- func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInfo)
- func (h Hooks) BeforeSlashingRedelegation(ctx sdk.Context, srcValidator stakingtypes.Validator, ...) error
- func (h Hooks) BeforeSlashingUnbondingDelegation(ctx sdk.Context, unbondingDelegation stakingtypes.UnbondingDelegation, ...) error
- func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
- type Keeper
- func (k Keeper) AfterClaim(ctx sdk.Context, airdropIdentifier string, claimAmount sdkmath.Int) error
- func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochInfo epochstypes.EpochInfo)
- func (k Keeper) AfterLiquidStake(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInfo)
- func (k Keeper) ClaimAllCoinsForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action) (sdk.Coins, error)
- func (k Keeper) ClaimCoinsForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, ...) (sdk.Coins, error)
- func (k Keeper) ClaimRecord(goCtx context.Context, req *types.QueryClaimRecordRequest) (*types.QueryClaimRecordResponse, error)
- func (k Keeper) ClaimableForAction(goCtx context.Context, req *types.QueryClaimableForActionRequest) (*types.QueryClaimableForActionResponse, error)
- func (k Keeper) CreateAirdropAndEpoch(ctx sdk.Context, distributor string, denom string, startTime uint64, ...) error
- func (k Keeper) DeleteAirdropAndEpoch(ctx sdk.Context, identifier string) error
- func (k Keeper) DeleteTotalWeight(ctx sdk.Context, airdropIdentifier string)
- func (k Keeper) DistributorAccountBalance(c context.Context, req *types.QueryDistributorAccountBalanceRequest) (*types.QueryDistributorAccountBalanceResponse, error)
- func (k Keeper) EndAirdrop(ctx sdk.Context, airdropIdentifier string) error
- func (k Keeper) EndBlocker(ctx sdk.Context)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAirdropByDistributor(ctx sdk.Context, distributor string) *types.Airdrop
- func (k Keeper) GetAirdropByIdentifier(ctx sdk.Context, airdropIdentifier string) *types.Airdrop
- func (k Keeper) GetAirdropClaimDenom(ctx sdk.Context, airdropIdentifier string) (string, error)
- func (k Keeper) GetAirdropDistributor(ctx sdk.Context, airdropIdentifier string) (sdk.AccAddress, error)
- func (k Keeper) GetAirdropIdentifiersForUser(ctx sdk.Context, addr sdk.AccAddress) []string
- func (k Keeper) GetClaimRecord(ctx sdk.Context, addr sdk.AccAddress, airdropIdentifier string) (types.ClaimRecord, error)
- func (k Keeper) GetClaimRecords(ctx sdk.Context, airdropIdentifier string) []types.ClaimRecord
- func (k Keeper) GetClaimableAmountForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, ...) (sdk.Coins, error)
- func (k Keeper) GetDistributorAccountBalance(ctx sdk.Context, airdropIdentifier string) (sdk.Coin, error)
- func (k Keeper) GetParams(ctx sdk.Context) (types.Params, error)
- func (k Keeper) GetTotalWeight(ctx sdk.Context, airdropIdentifier string) (sdk.Dec, error)
- func (k Keeper) GetUnallocatedUsers(ctx sdk.Context, identifier string, users []string, weights []sdk.Dec) ([]string, []sdk.Dec)
- func (k Keeper) GetUserTotalClaimable(ctx sdk.Context, addr sdk.AccAddress, airdropIdentifier string, ...) (sdk.Coins, error)
- func (k Keeper) GetUserVestings(ctx sdk.Context, addr sdk.AccAddress) (vestingtypes.Periods, sdk.Coins)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IncrementClaimedSoFar(ctx sdk.Context, identifier string, amount sdkmath.Int) error
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IsInitialPeriodPassed(ctx sdk.Context, airdropIdentifier string) bool
- func (k Keeper) LoadAllocationData(ctx sdk.Context, allocationData string) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ResetClaimStatus(ctx sdk.Context, airdropIdentifier string) error
- func (k Keeper) ResetClaimedSoFar(ctx sdk.Context) error
- func (k Keeper) SetClaimRecord(ctx sdk.Context, claimRecord types.ClaimRecord) error
- func (k Keeper) SetClaimRecords(ctx sdk.Context, claimRecords []types.ClaimRecord) error
- func (k Keeper) SetClaimRecordsWithWeights(ctx sdk.Context, claimRecords []types.ClaimRecord) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) SetTotalWeight(ctx sdk.Context, totalWeight sdk.Dec, airdropIdentifier string)
- func (k Keeper) TotalClaimable(goCtx context.Context, req *types.QueryTotalClaimableRequest) (*types.QueryTotalClaimableResponse, error)
- func (k Keeper) UserVestings(goCtx context.Context, req *types.QueryUserVestingsRequest) (*types.QueryUserVestingsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAirdropDurationForAction ¶
Get airdrop duration for action
func NewMsgServerImpl ¶
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier returns legacy querier endpoint
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for claim keeper
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) AfterEpochEnd ¶
func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochInfo epochstypes.EpochInfo)
func (Hooks) AfterLiquidStake ¶
func (h Hooks) AfterLiquidStake(ctx sdk.Context, addr sdk.AccAddress)
ibcstaking hooks
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
func (Hooks) AfterValidatorCreated ¶
staking hooks
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Hooks) BeforeEpochStart ¶
func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInfo)
epochs hooks
func (Hooks) BeforeSlashingRedelegation ¶
func (h Hooks) BeforeSlashingRedelegation(ctx sdk.Context, srcValidator stakingtypes.Validator, redelegation stakingtypes.Redelegation, infractionHeight int64, slashFactor sdk.Dec) error
func (Hooks) BeforeSlashingUnbondingDelegation ¶
func (h Hooks) BeforeSlashingUnbondingDelegation(ctx sdk.Context, unbondingDelegation stakingtypes.UnbondingDelegation, infractionHeight int64, slashFactor sdk.Dec) error
func (Hooks) BeforeValidatorModified ¶
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper struct
func NewKeeper ¶
func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, dk types.DistrKeeper, ek types.EpochsKeeper) *Keeper
NewKeeper returns keeper
func (Keeper) AfterClaim ¶
func (Keeper) AfterDelegationModified ¶
func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
func (Keeper) AfterEpochEnd ¶
func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochInfo epochstypes.EpochInfo)
func (Keeper) AfterLiquidStake ¶
func (k Keeper) AfterLiquidStake(ctx sdk.Context, addr sdk.AccAddress)
func (Keeper) BeforeEpochStart ¶
func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInfo)
func (Keeper) ClaimAllCoinsForAction ¶
func (Keeper) ClaimCoinsForAction ¶
func (k Keeper) ClaimCoinsForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, airdropIdentifier string) (sdk.Coins, error)
ClaimCoins remove claimable amount entry and transfer it to user's account
func (Keeper) ClaimRecord ¶
func (k Keeper) ClaimRecord( goCtx context.Context, req *types.QueryClaimRecordRequest, ) (*types.QueryClaimRecordResponse, error)
ClaimRecord returns user claim record by address and airdrop identifier
func (Keeper) ClaimableForAction ¶
func (k Keeper) ClaimableForAction( goCtx context.Context, req *types.QueryClaimableForActionRequest, ) (*types.QueryClaimableForActionResponse, error)
ClaimableForAction returns claimable amount per action
func (Keeper) CreateAirdropAndEpoch ¶
func (k Keeper) CreateAirdropAndEpoch(ctx sdk.Context, distributor string, denom string, startTime uint64, duration uint64, identifier string) error
CreateAirdropAndEpoch creates a new airdrop and epoch for that.
func (Keeper) DeleteAirdropAndEpoch ¶
DeleteAirdropAndEpoch deletes existing airdrop and corresponding epoch.
func (Keeper) DeleteTotalWeight ¶
DeleteTotalWeight deletes total weights for airdrop
func (Keeper) DistributorAccountBalance ¶
func (k Keeper) DistributorAccountBalance(c context.Context, req *types.QueryDistributorAccountBalanceRequest) (*types.QueryDistributorAccountBalanceResponse, error)
Params returns balances of the distributor account
func (Keeper) EndAirdrop ¶
EndAirdrop ends airdrop and clear all user claim records
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the capability module's exported genesis.
func (Keeper) GetAirdropByDistributor ¶
Get airdrop by distributor
func (Keeper) GetAirdropByIdentifier ¶
Get airdrop by identifier
func (Keeper) GetAirdropClaimDenom ¶
Get airdrop claim denom
func (Keeper) GetAirdropDistributor ¶
func (k Keeper) GetAirdropDistributor(ctx sdk.Context, airdropIdentifier string) (sdk.AccAddress, error)
Get airdrop distributor address
func (Keeper) GetAirdropIdentifiersForUser ¶
Get airdrop identifier corresponding to the user address
func (Keeper) GetClaimRecord ¶
func (k Keeper) GetClaimRecord(ctx sdk.Context, addr sdk.AccAddress, airdropIdentifier string) (types.ClaimRecord, error)
GetClaimRecord returns the claim record for a specific address
func (Keeper) GetClaimRecords ¶
GetClaimables get claimables for genesis export
func (Keeper) GetClaimableAmountForAction ¶
func (k Keeper) GetClaimableAmountForAction(ctx sdk.Context, addr sdk.AccAddress, action types.Action, airdropIdentifier string, includeClaimed bool) (sdk.Coins, error)
GetClaimable returns claimable amount for a specific action done by an address
func (Keeper) GetDistributorAccountBalance ¶
func (k Keeper) GetDistributorAccountBalance(ctx sdk.Context, airdropIdentifier string) (sdk.Coin, error)
GetDistributorAccountBalance gets the airdrop coin balance of module account
func (Keeper) GetTotalWeight ¶
GetTotalWeight gets total sum of user weights in store
func (Keeper) GetUnallocatedUsers ¶
func (k Keeper) GetUnallocatedUsers(ctx sdk.Context, identifier string, users []string, weights []sdk.Dec) ([]string, []sdk.Dec)
Remove duplicated airdrops for given params
func (Keeper) GetUserTotalClaimable ¶
func (k Keeper) GetUserTotalClaimable(ctx sdk.Context, addr sdk.AccAddress, airdropIdentifier string, includeClaimed bool) (sdk.Coins, error)
GetClaimable returns claimable amount for a specific action done by an address
func (Keeper) GetUserVestings ¶
func (k Keeper) GetUserVestings(ctx sdk.Context, addr sdk.AccAddress) (vestingtypes.Periods, sdk.Coins)
GetUserVestings returns all vestings associated to the user account
func (Keeper) IncrementClaimedSoFar ¶
IncrementClaimedSoFar increments ClaimedSoFar for a single airdrop
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the capability module's state from a provided genesis state.
func (Keeper) IsInitialPeriodPassed ¶
func (Keeper) LoadAllocationData ¶
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns params of the claim module.
func (Keeper) ResetClaimStatus ¶
ResetClaimStatus clear users' claimed status only after initial period of vesting is passed
func (Keeper) ResetClaimedSoFar ¶
ResetClaimedSoFar resets ClaimedSoFar for a all airdrops
func (Keeper) SetClaimRecord ¶
SetClaimRecord sets a claim record for an address in store
func (Keeper) SetClaimRecords ¶
SetClaimRecords set claim records and total weights
func (Keeper) SetClaimRecordsWithWeights ¶
func (Keeper) SetTotalWeight ¶
SetTotalWeight sets total sum of user weights in store
func (Keeper) TotalClaimable ¶
func (k Keeper) TotalClaimable( goCtx context.Context, req *types.QueryTotalClaimableRequest, ) (*types.QueryTotalClaimableResponse, error)
TotalClaimable returns total claimable amount for user
func (Keeper) UserVestings ¶
func (k Keeper) UserVestings( goCtx context.Context, req *types.QueryUserVestingsRequest, ) (*types.QueryUserVestingsResponse, error)
UserVestings returns all vestings for user