Documentation
¶
Index ¶
- func NewQueryServerImpl(k Keeper) types.QueryServer
- type Keeper
- func (k Keeper) BlockedAddr(addr sdk.AccAddress) bool
- func (k Keeper) BurnCoins(goCtx context.Context, moduleName string, amt sdk.Coins) error
- func (k *Keeper) DeleteFractionalBalance(ctx sdk.Context, address sdk.AccAddress)
- func (k *Keeper) DeleteRemainderAmount(ctx sdk.Context)
- func (k Keeper) GetBalance(goCtx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
- func (k Keeper) GetDenomMetaData(ctx context.Context, denom string) (banktypes.Metadata, bool)
- func (k *Keeper) GetFractionalBalance(ctx sdk.Context, address sdk.AccAddress) sdkmath.Int
- func (k *Keeper) GetRemainderAmount(ctx sdk.Context) sdkmath.Int
- func (k Keeper) GetSupply(ctx context.Context, denom string) sdk.Coin
- func (k *Keeper) GetTotalSumFractionalBalances(ctx sdk.Context) sdkmath.Int
- func (k Keeper) IsSendEnabledCoin(ctx context.Context, coin sdk.Coin) bool
- func (k Keeper) IsSendEnabledCoins(ctx context.Context, coins ...sdk.Coin) error
- func (k Keeper) IterateAccountBalances(ctx context.Context, account sdk.AccAddress, cb func(coin sdk.Coin) bool)
- func (k *Keeper) IterateFractionalBalances(ctx sdk.Context, ...)
- func (k Keeper) IterateTotalSupply(ctx context.Context, cb func(coin sdk.Coin) bool)
- func (k Keeper) MintCoins(goCtx context.Context, moduleName string, amt sdk.Coins) error
- func (k Keeper) Send(goCtx context.Context, msg *banktypes.MsgSend) (*banktypes.MsgSendResponse, error)
- func (k Keeper) SendCoins(goCtx context.Context, from, to sdk.AccAddress, amt sdk.Coins) error
- func (k Keeper) SendCoinsFromAccountToModule(goCtx context.Context, senderAddr sdk.AccAddress, recipientModule string, ...) error
- func (k Keeper) SendCoinsFromModuleToAccount(goCtx context.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SendCoinsFromModuleToModule(goCtx context.Context, senderModule string, recipientModule string, ...) error
- func (k Keeper) SetDenomMetaData(ctx context.Context, denomMetaData banktypes.Metadata)
- func (k *Keeper) SetFractionalBalance(ctx sdk.Context, address sdk.AccAddress, amount sdkmath.Int)
- func (k *Keeper) SetRemainderAmount(ctx sdk.Context, amount sdkmath.Int)
- func (k Keeper) SpendableCoin(goCtx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
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 ¶
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 ¶
DeleteRemainderAmount deletes the internal remainder amount.
func (Keeper) GetBalance ¶
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 (*Keeper) GetFractionalBalance ¶
GetFractionalBalance returns the fractional balance for an address.
func (*Keeper) GetRemainderAmount ¶
GetRemainderAmount returns the internal remainder amount.
func (*Keeper) GetTotalSumFractionalBalances ¶
GetTotalSumFractionalBalances returns the sum of all fractional balances.
func (Keeper) IsSendEnabledCoin ¶ added in v0.3.0
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 ¶
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 (*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 (Keeper) MintCoins ¶
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
func (k Keeper) Send(goCtx context.Context, msg *banktypes.MsgSend) (*banktypes.MsgSendResponse, error)
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 ¶
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 (*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 ¶
SetRemainderAmount sets the internal remainder amount.
func (Keeper) SpendableCoin ¶
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.