Documentation ¶
Index ¶
- func NewQueryServiceServer(k Keeper) types.QueryServiceServer
- type Keeper
- func (k *Keeper) Add(ctx sdk.Context, addr sdk.AccAddress, coins sdk.Coins) error
- func (k *Keeper) GetDeposit(ctx sdk.Context, addr sdk.AccAddress) (deposit types.Deposit, found bool)
- func (k *Keeper) GetDeposits(ctx sdk.Context) (items types.Deposits)
- func (k *Keeper) IterateDeposits(ctx sdk.Context, fn func(index int, item types.Deposit) (stop bool))
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) SendCoinsFromAccountToDeposit(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) error
- func (k *Keeper) SendCoinsFromDepositToAccount(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) error
- func (k *Keeper) SendCoinsFromDepositToModule(ctx sdk.Context, fromAddr sdk.AccAddress, toModule string, coins sdk.Coins) error
- func (k *Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit)
- func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore
- func (k *Keeper) Subtract(ctx sdk.Context, addr sdk.AccAddress, coins sdk.Coins) error
- func (k *Keeper) WithBankKeeper(keeper expected.BankKeeper)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQueryServiceServer ¶ added in v0.6.0
func NewQueryServiceServer(k Keeper) types.QueryServiceServer
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (*Keeper) Add ¶
Add is a utility function to add coins to a deposit by transferring from the account to the deposit.
func (*Keeper) GetDeposit ¶
func (k *Keeper) GetDeposit(ctx sdk.Context, addr sdk.AccAddress) (deposit types.Deposit, found bool)
GetDeposit retrieves a deposit from the module's KVStore based on the account address. If the deposit exists, it returns the deposit and 'found' as true; otherwise, it returns 'found' as false.
func (*Keeper) GetDeposits ¶ added in v0.3.0
GetDeposits retrieves all deposits stored in the module's KVStore.
func (*Keeper) IterateDeposits ¶
func (k *Keeper) IterateDeposits(ctx sdk.Context, fn func(index int, item types.Deposit) (stop bool))
IterateDeposits iterates over all deposits stored in the module's KVStore and calls the provided function for each deposit. The iteration stops when the provided function returns 'true'.
func (*Keeper) SendCoinsFromAccountToDeposit ¶ added in v0.3.0
func (k *Keeper) SendCoinsFromAccountToDeposit(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) error
SendCoinsFromAccountToDeposit transfers coins from an account to a deposit and updates the deposit in the KVStore. If the deposit does not exist, a new deposit will be created. It returns an error if the account doesn't have enough balance.
func (*Keeper) SendCoinsFromDepositToAccount ¶ added in v0.3.0
func (k *Keeper) SendCoinsFromDepositToAccount(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) error
SendCoinsFromDepositToAccount transfers coins from a deposit to an account and updates the deposit in the KVStore. It returns an error if the deposit doesn't have enough balance.
func (*Keeper) SendCoinsFromDepositToModule ¶ added in v0.10.0
func (k *Keeper) SendCoinsFromDepositToModule(ctx sdk.Context, fromAddr sdk.AccAddress, toModule string, coins sdk.Coins) error
SendCoinsFromDepositToModule transfers coins from a deposit to a module and updates the deposit in the KVStore. It returns an error if the deposit doesn't have enough balance.
func (*Keeper) SetDeposit ¶
SetDeposit stores a deposit in the module's KVStore.
func (*Keeper) Subtract ¶
Subtract is a utility function to subtract coins from a deposit by transferring from the deposit to the account.
func (*Keeper) WithBankKeeper ¶ added in v0.6.0
func (k *Keeper) WithBankKeeper(keeper expected.BankKeeper)