keeper

package
v0.0.0-...-aa3d8a7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinRes

type CoinRes struct {
	Price float64 `json:"price"`
}

type Keeper

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

Keeper defines the IBC price keeper

func NewKeeper

func NewKeeper(
	paramSpace paramtypes.Subspace,
	channelKeeper icptypes.ChannelKeeper,
	portKeeper icptypes.PortKeeper,
	scopedKeeper capabilitykeeper.ScopedKeeper,
) Keeper

NewKeeper creates a new IBC price Keeper instance

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) ClaimCapability

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

ClaimCapability wraps the scopedKeeper's ClaimCapability function

func (Keeper) GetCoinPrice

func (q Keeper) GetCoinPrice(coin string) (float64, error)

get price of one coin get price over ibc packet

func (Keeper) GetPairPrice

func (q Keeper) GetPairPrice(pair [2]string) ([2]float64, error)

get price of both coins

func (Keeper) IsHostEnabled

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

IsHostEnabled retrieves the host enabled boolean from the paramstore. True is returned if the host submodule is enabled.

func (Keeper) MarshalDenomTrace

func (k Keeper) MarshalDenomTrace(denomTrace types.DenomTrace) ([]byte, error)

MarshalDenomTrace attempts to encode an DenomTrace object and returns the raw encoded bytes.

func (Keeper) MustMarshalDenomTrace

func (k Keeper) MustMarshalDenomTrace(denomTrace types.DenomTrace) []byte

MustMarshalDenomTrace attempts to encode an DenomTrace object and returns the raw encoded bytes. It panics on error.

func (Keeper) MustUnmarshalDenomTrace

func (k Keeper) MustUnmarshalDenomTrace(bz []byte) types.DenomTrace

MustUnmarshalDenomTrace attempts to decode and return an DenomTrace object from raw encoded bytes. It panics on error.

func (Keeper) OnChanOpenTry

func (k Keeper) OnChanOpenTry(
	ctx sdk.Context,
	order channeltypes.Order,
	connectionHops []string,
	portID,
	channelID string,
	chanCap *capabilitytypes.Capability,
	counterparty channeltypes.Counterparty,
	version,
	counterpartyVersion string,
) error

OnChanOpenTry performs basic validation of the ICP channel and registers a new interchain account (if it doesn't exist).

func (Keeper) UnmarshalDenomTrace

func (k Keeper) UnmarshalDenomTrace(bz []byte) (types.DenomTrace, error)

UnmarshalDenomTrace attempts to decode and return an DenomTrace object from raw encoded bytes.

Jump to

Keyboard shortcuts

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