keeper

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 16 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) types.QueryServer

NewQueryServerImpl creates a new server for handling gRPC queries.

Types

type Keeper

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

Keeper defines the precisebank module's keeper

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	bk types.BankKeeper,
	ak types.AccountKeeper,
) Keeper

NewKeeper creates a new keeper

func (Keeper) BlockedAddr added in v0.3.0

func (k Keeper) BlockedAddr(addr sdk.AccAddress) bool

func (Keeper) BurnCoins

func (k Keeper) BurnCoins(goCtx context.Context, moduleName string, amt sdk.Coins) error

BurnCoins burns coins deletes coins from the balance of the module account. It will panic if the module account does not exist or is unauthorized.

func (*Keeper) DeleteFractionalBalance

func (k *Keeper) DeleteFractionalBalance(
	ctx sdk.Context,
	address sdk.AccAddress,
)

DeleteFractionalBalance deletes the fractional balance for an address.

func (*Keeper) DeleteRemainderAmount

func (k *Keeper) DeleteRemainderAmount(
	ctx sdk.Context,
)

DeleteRemainderAmount deletes the internal remainder amount.

func (Keeper) GetBalance

func (k Keeper) GetBalance(
	goCtx context.Context,
	addr sdk.AccAddress,
	denom string,
) sdk.Coin

GetBalance returns the balance of a specific denom for an address. This will return the extended balance for the ExtendedCoinDenom, and the regular balance for all other denoms.

func (Keeper) GetDenomMetaData added in v0.3.0

func (k Keeper) GetDenomMetaData(ctx context.Context, denom string) (banktypes.Metadata, bool)

func (*Keeper) GetFractionalBalance

func (k *Keeper) GetFractionalBalance(ctx sdk.Context, address sdk.AccAddress) sdkmath.Int

GetFractionalBalance returns the fractional balance for an address.

func (*Keeper) GetRemainderAmount

func (k *Keeper) GetRemainderAmount(
	ctx sdk.Context,
) sdkmath.Int

GetRemainderAmount returns the internal remainder amount.

func (Keeper) GetSupply

func (k Keeper) GetSupply(ctx context.Context, denom string) sdk.Coin

func (*Keeper) GetTotalSumFractionalBalances

func (k *Keeper) GetTotalSumFractionalBalances(ctx sdk.Context) sdkmath.Int

GetTotalSumFractionalBalances returns the sum of all fractional balances.

func (Keeper) IsSendEnabledCoin added in v0.3.0

func (k Keeper) IsSendEnabledCoin(ctx context.Context, coin sdk.Coin) bool

IsSendEnabledCoin checks whether the sent coin is the extended denom, in which case it also checks for the SendEnabled status on the EVM denom. The rest pass through the regular bank keeper implementation.

func (Keeper) IsSendEnabledCoins

func (k Keeper) IsSendEnabledCoins(ctx context.Context, coins ...sdk.Coin) error

IsSendEnabledCoins uses the parent x/bank keeper to check the coins provided and returns an ErrSendDisabled if any of the coins are not configured for sending. Returns nil if sending is enabled for all provided coin. Note: This method is not used directly by x/evm, but is still required as part of authtypes.BankKeeper. x/evm uses auth methods that require this interface.

func (Keeper) IterateAccountBalances

func (k Keeper) IterateAccountBalances(ctx context.Context, account sdk.AccAddress, cb func(coin sdk.Coin) bool)

func (*Keeper) IterateFractionalBalances

func (k *Keeper) IterateFractionalBalances(
	ctx sdk.Context,
	cb func(address sdk.AccAddress, amount sdkmath.Int) (stop bool),
)

IterateFractionalBalances iterates over all fractional balances in the store and performs a callback function.

func (Keeper) IterateTotalSupply

func (k Keeper) IterateTotalSupply(ctx context.Context, cb func(coin sdk.Coin) bool)

func (Keeper) MintCoins

func (k Keeper) MintCoins(goCtx context.Context, moduleName string, amt sdk.Coins) error

MintCoins creates new coins from thin air and adds it to the module account. If ExtendedCoinDenom is provided, the corresponding fractional amount is added to the module state. It will panic if the module account does not exist or is unauthorized.

func (Keeper) Send added in v0.3.0

Send is a forked Send from the Cosmos SDK x/bank MsgServer, minus the BaseKeeper type validation. ref: https://github.com/cosmos/cosmos-sdk/blob/e265bb9b42308dc70743b6200a70db9aafb70527/x/bank/keeper/msg_server.go#L29

func (Keeper) SendCoins

func (k Keeper) SendCoins(
	goCtx context.Context,
	from, to sdk.AccAddress,
	amt sdk.Coins,
) error

SendCoins transfers amt coins from a sending account to a receiving account. An error is returned upon failure. This handles transfers including ExtendedCoinDenom and supports non-ExtendedCoinDenom transfers by passing through to x/bank.

func (Keeper) SendCoinsFromAccountToModule

func (k Keeper) SendCoinsFromAccountToModule(
	goCtx context.Context,
	senderAddr sdk.AccAddress,
	recipientModule string,
	amt sdk.Coins,
) error

SendCoinsFromModuleToModule transfers coins from a ModuleAccount to another. It will panic if either module account does not exist. An error is returned if the recipient module is the x/precisebank module account or if sending the tokens fails.

func (Keeper) SendCoinsFromModuleToAccount

func (k Keeper) SendCoinsFromModuleToAccount(
	goCtx context.Context,
	senderModule string,
	recipientAddr sdk.AccAddress,
	amt sdk.Coins,
) error

SendCoinsFromModuleToAccount transfers coins from a ModuleAccount to an AccAddress. It will panic if the module account does not exist. An error is returned if the recipient address is blocked, if the sender is the x/precisebank module account, or if sending the tokens fails.

func (Keeper) SendCoinsFromModuleToModule

func (k Keeper) SendCoinsFromModuleToModule(
	goCtx context.Context,
	senderModule string,
	recipientModule string,
	amt sdk.Coins,
) error

SendCoinsFromModuleToModule transfers coins from a ModuleAccount to another. It will panic if either module account does not exist. An error is returned if the recipient module is the x/precisebank module account or if sending the tokens fails.

func (Keeper) SetDenomMetaData added in v0.3.0

func (k Keeper) SetDenomMetaData(ctx context.Context, denomMetaData banktypes.Metadata)

func (*Keeper) SetFractionalBalance

func (k *Keeper) SetFractionalBalance(
	ctx sdk.Context,
	address sdk.AccAddress,
	amount sdkmath.Int,
)

SetFractionalBalance sets the fractional balance for an address.

func (*Keeper) SetRemainderAmount

func (k *Keeper) SetRemainderAmount(
	ctx sdk.Context,
	amount sdkmath.Int,
)

SetRemainderAmount sets the internal remainder amount.

func (Keeper) SpendableCoin

func (k Keeper) SpendableCoin(
	goCtx context.Context,
	addr sdk.AccAddress,
	denom string,
) sdk.Coin

SpendableCoins returns the total balances of spendable coins for an account by address. If the account has no spendable coins, an empty Coins slice is returned.

Jump to

Keyboard shortcuts

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