keeper

package
v2.1.0-a9 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RemintCreditsKey = collections.NewPrefix([]byte{0x01, 0x00})
	TotalBurnedKey   = collections.NewPrefix([]byte{0x02, 0x01})
	TotalMintedKey   = collections.NewPrefix([]byte{0x02, 0x02})
	LedgerKey        = collections.NewPrefix([]byte{0x03, 0x00})
	ParamsKey        = collections.NewPrefix([]byte{0x09, 0x00}) // key for bme module params
)

Functions

This section is empty.

Types

type Keeper

type Keeper interface {
	StoreKey() storetypes.StoreKey
	Codec() codec.BinaryCodec
	GetParams(sdk.Context) (bmetypes.Params, error)
	SetParams(sdk.Context, bmetypes.Params) error

	GetVaultState(sdk.Context) (bmetypes.State, error)

	GetCircuitBreakerStatus(sdk.Context) (bmetypes.CircuitBreakerStatus, error)
	GetCollateralRatio(sdk.Context) (sdkmath.LegacyDec, error)

	BeginBlocker(_ context.Context) error
	EndBlocker(context.Context) error

	BurnMintFromAddressToModuleAccount(sdk.Context, sdk.AccAddress, string, sdk.Coin, string) (sdk.DecCoin, error)
	BurnMintFromModuleAccountToAddress(sdk.Context, string, sdk.AccAddress, sdk.Coin, string) (sdk.DecCoin, error)
	BurnMintOnAccount(sdk.Context, sdk.AccAddress, sdk.Coin, string) (sdk.DecCoin, error)

	NewQuerier() Querier
	GetAuthority() string
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	skey *storetypes.KVStoreKey,
	authority string,
	accKeeper bmeimports.AccountKeeper,
	bankKeeper bmeimports.BankKeeper,
	oracleKeeper bmeimports.OracleKeeper,
) Keeper

type Querier

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

func (Querier) BeginBlocker

func (k Querier) BeginBlocker(_ context.Context) error

BeginBlocker is called at the beginning of each block

func (Querier) BurnMintFromAddressToModuleAccount

func (k Querier) BurnMintFromAddressToModuleAccount(
	sctx sdk.Context,
	srcAddr sdk.AccAddress,
	moduleAccount string,
	burnCoin sdk.Coin,
	toDenom string,
) (sdk.DecCoin, error)

BurnMintFromAddressToModuleAccount collateralizes coins from source address into module account, mints new coins with price fetched from oracle, and sends minted coins to a module account

func (Querier) BurnMintFromModuleAccountToAddress

func (k Querier) BurnMintFromModuleAccountToAddress(
	sctx sdk.Context,
	moduleAccount string,
	dstAddr sdk.AccAddress,
	burnCoin sdk.Coin,
	toDenom string,
) (sdk.DecCoin, error)

BurnMintFromModuleAccountToAddress burns coins from a module account, mints new coins with price fetched from oracle, and sends minted coins to an account

func (Querier) BurnMintOnAccount

func (k Querier) BurnMintOnAccount(sctx sdk.Context, addr sdk.AccAddress, burnCoin sdk.Coin, toDenom string) (sdk.DecCoin, error)

BurnMintOnAccount burns coins from an account, mints new coins with price fetched from oracle and sends minted coins to the same account

func (Querier) Codec

func (k Querier) Codec() codec.BinaryCodec

Codec returns keeper codec

func (Querier) EndBlocker

func (k Querier) EndBlocker(_ context.Context) error

EndBlocker is called at the end of each block to manage snapshots. It records periodic snapshots and prunes old ones.

func (Querier) GetAuthority

func (k Querier) GetAuthority() string

func (Querier) GetCircuitBreakerStatus

func (k Querier) GetCircuitBreakerStatus(ctx sdk.Context) (bmetypes.CircuitBreakerStatus, error)

func (Querier) GetCollateralRatio

func (k Querier) GetCollateralRatio(sctx sdk.Context) (sdkmath.LegacyDec, error)

GetCollateralRatio calculates CR, for example, CR = (bme balance of AKT * price in USD) / bme balance of ACT

func (Querier) GetParams

func (k Querier) GetParams(ctx sdk.Context) (bmetypes.Params, error)

func (Querier) GetVaultState

func (k Querier) GetVaultState(ctx sdk.Context) (bmetypes.State, error)

func (Querier) Logger

func (k Querier) Logger(sctx sdk.Context) log.Logger

func (Querier) NewQuerier

func (k Querier) NewQuerier() Querier

func (Querier) Params

func (Querier) SetParams

func (k Querier) SetParams(ctx sdk.Context, params bmetypes.Params) error

func (Querier) StoreKey

func (k Querier) StoreKey() storetypes.StoreKey

StoreKey returns store key

Jump to

Keyboard shortcuts

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