keeper

package
v0.0.0-...-c12136b Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandlers

func NewHandlers(k *Keeper) handlers

NewHandlers creates a new bank/v2 handlers

Types

type BalancesIndexes

type BalancesIndexes struct {
	Denom *indexes.ReversePair[[]byte, string, math.Int]
}

type Keeper

type Keeper struct {
	appmodulev2.Environment
	// contains filtered or unexported fields
}

Keeper defines the bank/v2 module keeper. All fields are not exported, as they should only be accessed through the module's.

func NewKeeper

func NewKeeper(authority []byte, addressCodec address.Codec, env appmodulev2.Environment, cdc codec.BinaryCodec) *Keeper

func (Keeper) AppendGlobalSendRestriction

func (k Keeper) AppendGlobalSendRestriction(restriction types.SendRestrictionFn)

AppendGlobalSendRestriction adds the provided SendRestrictionFn to run after previously provided global restrictions.

func (Keeper) ClearGlobalSendRestriction

func (k Keeper) ClearGlobalSendRestriction()

ClearGlobalSendRestriction removes the global send restriction (if there is one).

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error)

func (Keeper) GetBalance

func (k Keeper) GetBalance(ctx context.Context, addr []byte, denom string) sdk.Coin

GetBalance returns the balance of a specific denomination for a given account by address.

func (Keeper) GetSupply

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

GetSupply retrieves the Supply from store

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx context.Context, state *types.GenesisState) error

InitGenesis initializes the bank/v2 module genesis state.

func (Keeper) MintCoins

func (k Keeper) MintCoins(ctx context.Context, addr []byte, amounts sdk.Coins) error

MintCoins creates new coins from thin air and adds it to the module account. An error is returned if the module account does not exist or is unauthorized.

func (Keeper) PrependGlobalSendRestriction

func (k Keeper) PrependGlobalSendRestriction(restriction types.SendRestrictionFn)

PrependGlobalSendRestriction adds the provided SendRestrictionFn to run before previously provided global restrictions.

func (Keeper) SendCoins

func (k Keeper) SendCoins(ctx context.Context, from, to []byte, amt sdk.Coins) error

SendCoins transfers amt coins from a sending account to a receiving account. Function take sender & recipient as []byte. They can be sdk address or module name. An error is returned upon failure.

Jump to

Keyboard shortcuts

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