keeper

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AtomPrice   sdk.Int
	TestingMode bool = false
)

Functions

func GetPairIDBytes

func GetPairIDBytes(id uint64) []byte

func GetPairIDFromBytes

func GetPairIDFromBytes(bz []byte) uint64

func VerificationBurnDenomCoins

func VerificationBurnDenomCoins(coins sdk.Coins, pair types.Pair) error

func VerificationMintDenomCoins

func VerificationMintDenomCoins(coins sdk.Coins, pair types.Pair) error

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	channelKeeper types.ChannelKeeper,
	portKeeper types.PortKeeper,
	scopedKeeper capabilitykeeper.ScopedKeeper,
	bankKeeper types.BankKeeper,
	oracleKeeper types.OracleKeeper,
) *Keeper

func (Keeper) AddressEmptyCheck added in v0.1.2

func (k Keeper) AddressEmptyCheck(ctx sdk.Context) bool

func (Keeper) AllPairs added in v0.1.2

func (k Keeper) AllPairs(goCtx context.Context, req *types.AllPairsRequest) (*types.AllPairsResponse, error)

func (Keeper) AppendPair

func (k Keeper) AppendPair(
	ctx sdk.Context,
	pair types.Pair,
) uint64

func (Keeper) AuthenticateCapability

func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool

AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function

func (Keeper) BindPort

func (k Keeper) BindPort(ctx sdk.Context, portID string) error

BindPort defines a wrapper function for the port Keeper's function in order to expose it to module's InitGenesis function

func (Keeper) Burn

func (k Keeper) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error)

func (Keeper) CalculateAmountToMint

func (k Keeper) CalculateAmountToMint(ibcBaseTokenDenomAmount sdk.Int, atomPrice sdk.Int, mintingFee sdk.Int) sdk.Int

func (Keeper) CalculateAmountToSend

func (k Keeper) CalculateAmountToSend(qAssetTokenAmount sdk.Int, atomPrice sdk.Int, burningFee sdk.Int) sdk.Int

func (Keeper) CalculateBackingRatio added in v0.1.3

func (k Keeper) CalculateBackingRatio(qm sdk.Int, ar sdk.Int, atomPrice sdk.Int) (sdk.Int, error)

func (Keeper) CalculateBurningFeeForBurningFund

func (k Keeper) CalculateBurningFeeForBurningFund(qAssetTokenAmount sdk.Int, atomPrice sdk.Int, burningFee sdk.Int) sdk.Int

func (Keeper) CalculateMintingFeeForBurningFund

func (k Keeper) CalculateMintingFeeForBurningFund(ibcBaseTokenDenomAmount sdk.Int, atomPrice sdk.Int, mintingFee sdk.Int) sdk.Int

func (Keeper) ChanCloseInit

func (k Keeper) ChanCloseInit(ctx sdk.Context, portID, channelID string) error

ChanCloseInit defines a wrapper function for the channel Keeper's function.

func (Keeper) ChangeBurningFundAddress

func (k Keeper) ChangeBurningFundAddress(ctx sdk.Context, address sdk.AccAddress) error

func (Keeper) ChangeReserveFundAddress added in v0.1.1

func (k Keeper) ChangeReserveFundAddress(ctx sdk.Context, address sdk.AccAddress) error

func (Keeper) CheckBurnAmount added in v0.0.2

func (k Keeper) CheckBurnAmount(msgAmountIn string, pair types.Pair) error

func (Keeper) CheckMinAmount

func (k Keeper) CheckMinAmount(msgAmountIn string, pair types.Pair) error

func (Keeper) ClaimCapability

func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error

ClaimCapability allows the IBC app module to claim a capability that core IBC passes to it

func (Keeper) GMB_ExecuteBurn added in v0.2.1

func (k Keeper) GMB_ExecuteBurn(ctx sdk.Context, msg *types.MsgBurn, pair types.Pair) (error, sdk.Coin)

func (Keeper) GMB_ExecuteMint added in v0.2.1

func (k Keeper) GMB_ExecuteMint(ctx sdk.Context, msg *types.MsgMint, pair types.Pair) (error, sdk.Coin)

func (Keeper) GeneratePairIdHash

func (k Keeper) GeneratePairIdHash(denom1 string, denom2 string) string

func (Keeper) GetAllPair

func (k Keeper) GetAllPair(ctx sdk.Context) (list []types.Pair)

func (Keeper) GetAmountOutByAmountIn added in v0.0.2

func (Keeper) GetAtomPrice

func (k Keeper) GetAtomPrice(ctx sdk.Context, pair types.Pair) (sdk.Int, error)

func (Keeper) GetBurningFundAddress

func (k Keeper) GetBurningFundAddress(ctx sdk.Context) sdk.AccAddress

func (Keeper) GetPairByID

func (k Keeper) GetPairByID(ctx sdk.Context, id uint64) (val types.Pair, found bool)

func (Keeper) GetPairByPairID

func (k Keeper) GetPairByPairID(ctx sdk.Context, pairId string) (val types.Pair, found bool)

func (Keeper) GetPairCount

func (k Keeper) GetPairCount(ctx sdk.Context) uint64

func (Keeper) GetPairIdBurn

func (k Keeper) GetPairIdBurn(amountInt string, denom2 string) (string, error)

func (Keeper) GetPairIdMint

func (k Keeper) GetPairIdMint(amountInt string, denom2 string) (string, error)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

func (Keeper) GetPort

func (k Keeper) GetPort(ctx sdk.Context) string

GetPort returns the portID for the IBC app module. Used in ExportGenesis

func (Keeper) GetReserveFundAddress added in v0.1.1

func (k Keeper) GetReserveFundAddress(ctx sdk.Context) sdk.AccAddress

func (Keeper) IncreaseReserve

func (k Keeper) IncreaseReserve(ctx sdk.Context, amount1 sdk.Int, amount2 sdk.Int, pair types.Pair) types.Pair

func (Keeper) IsBound

func (k Keeper) IsBound(ctx sdk.Context, portID string) bool

IsBound checks if the IBC app module is already bound to the desired port

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Mint

func (k Keeper) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMintResponse, error)

func (Keeper) PairById

func (Keeper) PairByPairId

func (Keeper) Params

func (Keeper) ReduceReserve

func (k Keeper) ReduceReserve(ctx sdk.Context, amount1 sdk.Int, amount2 sdk.Int, pair types.Pair) types.Pair

func (Keeper) RegisterPair

func (k Keeper) RegisterPair(ctx sdk.Context, p types.Pair) error

func (Keeper) RemovePair

func (k Keeper) RemovePair(ctx sdk.Context, id uint64)

func (Keeper) SetBurningFundAddress

func (k Keeper) SetBurningFundAddress(ctx sdk.Context, newBurningFundAddress sdk.AccAddress)

func (Keeper) SetPair

func (k Keeper) SetPair(ctx sdk.Context, Pair types.Pair)

func (Keeper) SetPairCount

func (k Keeper) SetPairCount(ctx sdk.Context, count uint64)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (Keeper) SetPort

func (k Keeper) SetPort(ctx sdk.Context, portID string)

SetPort sets the portID for the IBC app module. Used in InitGenesis

func (Keeper) SetReserveFundAddress added in v0.1.1

func (k Keeper) SetReserveFundAddress(ctx sdk.Context, newReserveFundAddress sdk.AccAddress)

func (Keeper) SetTestingMode

func (k Keeper) SetTestingMode(value bool)

func (Keeper) UpdateAtomPrice

func (k Keeper) UpdateAtomPrice(ctx sdk.Context, pair types.Pair) error

func (Keeper) UpdateAtomPriceTesting

func (k Keeper) UpdateAtomPriceTesting(ctx sdk.Context, price sdk.Int) error

Jump to

Keyboard shortcuts

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