keeper

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type CommitmentKeeperI

type CommitmentKeeperI interface {
	// Initiate commitment according to standard staking
	StandardStakingToken(sdk.Context, string, string, string) error

	// Iterate all commitments
	IterateCommitments(sdk.Context, func(types.Commitments) (stop bool))

	// Update commitment
	SetCommitments(ctx sdk.Context, commitments types.Commitments)

	// Get commitment
	GetCommitments(sdk.Context, string) (types.Commitments, bool)

	// Withdraw tokens
	// context, creator, denom, amount
	ProcessWithdrawTokens(sdk.Context, string, string, sdk.Int) error

	// Withdraw validator commission
	// context, delegator, validator, denom, amount
	ProcessWithdrawValidatorCommission(sdk.Context, string, string, string, sdk.Int) error

	// Withdraw tokens - only USDC
	// context, creator, denom, amount
	ProcessWithdrawUSDC(ctx sdk.Context, creator string, denom string, amount sdk.Int) error
}

Interface declearation

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

Hooks wrapper struct for commitments keeper

func (Hooks) AfterEpochEnd

func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)

AfterEpochEnd implements EpochHooks

func (Hooks) BeforeEpochStart

func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)

BeforeEpochStart implements EpochHooks

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,

	bankKeeper types.BankKeeper,
	stakingKeeper types.StakingKeeper,
	apKeeper types.AssetProfileKeeper,
	authority string,
) *Keeper

func (Keeper) AfterCommitmentChange

func (k Keeper) AfterCommitmentChange(ctx sdk.Context, creator string, amount sdk.Coin)

Committed executes the indicated for committed hook

func (Keeper) AfterEpochEnd

func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64)

AfterEpochEnd distributes vested tokens at the end of each epoch

func (Keeper) BankKeeper

func (k Keeper) BankKeeper() types.BankKeeper

func (Keeper) BeforeEpochStart

func (k Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ int64)

BeforeEpochStart performs a no-op

func (Keeper) DeductCommitments

func (k Keeper) DeductCommitments(ctx sdk.Context, creator string, denom string, amount sdk.Int) (types.Commitments, error)

func (Keeper) DepositLiquidTokensUncommitted added in v0.13.0

func (k Keeper) DepositLiquidTokensUncommitted(ctx sdk.Context, denom string, amount sdk.Int, creator string) error

accounting the liquid token as a uncommitted token in commitment module.

func (Keeper) EdenUncommitted added in v0.12.0

func (k Keeper) EdenUncommitted(ctx sdk.Context, creator string, amount sdk.Coin)

Committed executes the indicated for committed hook

func (Keeper) GetCommitments

func (k Keeper) GetCommitments(
	ctx sdk.Context,
	creator string,

) (val types.Commitments, found bool)

GetCommitments returns a commitments from its index

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams returns the current parameters of the Commitment module

func (Keeper) GetVestingInfo

func (k Keeper) GetVestingInfo(ctx sdk.Context, baseDenom string) (*types.VestingInfo, int)

GetVestingDenom returns the vesting denom for the given base denom

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Return the wrapper struct

func (Keeper) IterateCommitments

func (k Keeper) IterateCommitments(
	ctx sdk.Context, handlerFn func(commitments types.Commitments) (stop bool),
)

IterateCommitments iterates over all Commitments and performs a callback.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Params

func (Keeper) ProcessTokenVesting added in v0.13.0

func (k Keeper) ProcessTokenVesting(ctx sdk.Context, denom string, amount sdk.Int, creator string) error

Vesting token Check if vesting entity count is not exceeding the maximum and if it is fine, creates a new vesting entity Deduct from uncommitted bucket. If it is insufficent, deduct from committed bucket as well.

func (Keeper) ProcessWithdrawTokens

func (k Keeper) ProcessWithdrawTokens(ctx sdk.Context, creator string, denom string, amount sdk.Int) error

Withdraw Token

func (Keeper) ProcessWithdrawUSDC

func (k Keeper) ProcessWithdrawUSDC(ctx sdk.Context, creator string, denom string, amount sdk.Int) error

Withdraw Token - USDC Only withraw USDC from dexRevenue wallet

func (Keeper) ProcessWithdrawValidatorCommission

func (k Keeper) ProcessWithdrawValidatorCommission(ctx sdk.Context, delegator string, creator string, denom string, amount sdk.Int) error

Withdraw validator's commission to self delegator

func (Keeper) RemoveCommitments

func (k Keeper) RemoveCommitments(
	ctx sdk.Context,
	creator string,

)

RemoveCommitments removes a commitments from the store

func (Keeper) SetCommitments

func (k Keeper) SetCommitments(ctx sdk.Context, commitments types.Commitments)

SetCommitments set a specific commitments in the store from its index

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(eh types.CommitmentHooks) *Keeper

SetHooks set the epoch hooks

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (Keeper) StandardStakingToken

func (k Keeper) StandardStakingToken(ctx sdk.Context, delegator string, validator string, denom string) error

Process standard staking elys token Create a commitment entity

func (Keeper) VestTokens

func (k Keeper) VestTokens(ctx sdk.Context, epochIdentifier string) error

type MultiCommitmentHooks

type MultiCommitmentHooks []types.CommitmentHooks

combine multiple commitment hooks, all hook functions are run in array sequence

func NewMultiEpochHooks

func NewMultiEpochHooks(hooks ...types.CommitmentHooks) MultiCommitmentHooks

func (MultiCommitmentHooks) CommitmentChanged

func (mh MultiCommitmentHooks) CommitmentChanged(ctx sdk.Context, creator string, amount sdk.Coin)

Committed is called when staker committed his token

func (MultiCommitmentHooks) EdenUncommitted added in v0.12.0

func (mh MultiCommitmentHooks) EdenUncommitted(ctx sdk.Context, creator string, amount sdk.Coin)

Committed is called when staker committed his token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL