keeper

package
v12.0.0-rc8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.Codec, key storetypes.StoreKey, capability ibcexported.ScopedKeeper, ics4 ibcporttypes.ICS4Wrapper,
	authority string,
) Keeper

func (*Keeper) AuthenticateCapability

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

func (*Keeper) BeginBlock

func (k *Keeper) BeginBlock(ctx sdk.Context)

BeginBlock is called at the beginning of each block to trigger IBC query packets for relevant assets.

func (*Keeper) ClaimCapability

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

func (*Keeper) DeleteAsset

func (k *Keeper) DeleteAsset(ctx sdk.Context, denom string)

DeleteAsset removes an asset from the module's KVStore based on the asset denomination.

func (*Keeper) DeleteDenomForPacket

func (k *Keeper) DeleteDenomForPacket(ctx sdk.Context, portID, channelID string, sequence uint64)

DeleteDenomForPacket removes a denomination for a packet from the module's KVStore based on the port ID, channel ID, and sequence.

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx sdk.Context) *v1.GenesisState

func (*Keeper) GetAsset

func (k *Keeper) GetAsset(ctx sdk.Context, denom string) (v v1.Asset, found bool)

GetAsset retrieves an asset from the module's KVStore based on the asset denomination. If the asset exists, it returns the asset and 'found' as true; otherwise, it returns 'found' as false.

func (*Keeper) GetAssetForPacket

func (k *Keeper) GetAssetForPacket(ctx sdk.Context, portID, channelID string, sequence uint64) (v v1.Asset, err error)

GetAssetForPacket retrieves an asset for a packet from the module's KVStore based on the port ID, channel ID, and sequence. If the asset exists, it returns the asset; otherwise, it returns an error.

func (*Keeper) GetAuthority

func (k *Keeper) GetAuthority() string

func (*Keeper) GetBlockInterval

func (k *Keeper) GetBlockInterval(ctx sdk.Context) int64

GetBlockInterval retrieves the BlockInterval parameter from the module's parameters.

func (*Keeper) GetChannelID

func (k *Keeper) GetChannelID(ctx sdk.Context) string

GetChannelID retrieves the ChannelID parameter from the module's parameters.

func (*Keeper) GetDenomForPacket

func (k *Keeper) GetDenomForPacket(ctx sdk.Context, portID, channelID string, sequence uint64) (v string, found bool)

GetDenomForPacket retrieves a denomination for a packet from the module's KVStore based on the port ID, channel ID, and sequence. If the denomination exists, it returns the denomination and 'found' as true; otherwise, it returns 'found' as false.

func (*Keeper) GetParams

func (k *Keeper) GetParams(ctx sdk.Context) (v v1.Params)

GetParams retrieves the oracle module parameters from the module's KVStore.

func (*Keeper) GetPortID

func (k *Keeper) GetPortID(ctx sdk.Context) string

GetPortID retrieves the PortID parameter from the module's parameters.

func (*Keeper) GetQueryTimeout

func (k *Keeper) GetQueryTimeout(ctx sdk.Context) int64

GetQueryTimeout returns the current block time adjusted by the module's timeout parameter in Unix nanoseconds.

func (*Keeper) GetQuotePrice

func (k *Keeper) GetQuotePrice(ctx sdk.Context, basePrice sdk.DecCoin) (sdk.Coin, error)

GetQuotePrice retrieves a quote for a given DecCoin, applying asset pricing if available. If the asset for the given denomination is not found, it returns an error.

func (*Keeper) GetTimeout

func (k *Keeper) GetTimeout(ctx sdk.Context) time.Duration

GetTimeout retrieves the Timeout parameter from the module's parameters.

func (*Keeper) HandleMsgCreateAsset

func (k *Keeper) HandleMsgCreateAsset(ctx sdk.Context, msg *v1.MsgCreateAssetRequest) (*v1.MsgCreateAssetResponse, error)

func (*Keeper) HandleMsgDeleteAsset

func (k *Keeper) HandleMsgDeleteAsset(ctx sdk.Context, msg *v1.MsgDeleteAssetRequest) (*v1.MsgDeleteAssetResponse, error)

func (*Keeper) HandleMsgUpdateAsset

func (k *Keeper) HandleMsgUpdateAsset(ctx sdk.Context, msg *v1.MsgUpdateAssetRequest) (*v1.MsgUpdateAssetResponse, error)

func (*Keeper) HandleMsgUpdateParams

func (k *Keeper) HandleMsgUpdateParams(ctx sdk.Context, msg *v1.MsgUpdateParamsRequest) (*v1.MsgUpdateParamsResponse, error)

func (*Keeper) HandleQueryAsset

func (k *Keeper) HandleQueryAsset(ctx sdk.Context, req *v1.QueryAssetRequest) (*v1.QueryAssetResponse, error)

func (*Keeper) HandleQueryAssets

func (k *Keeper) HandleQueryAssets(ctx sdk.Context, req *v1.QueryAssetsRequest) (res *v1.QueryAssetsResponse, err error)

func (*Keeper) HandleQueryParams

func (k *Keeper) HandleQueryParams(ctx sdk.Context, _ *v1.QueryParamsRequest) (*v1.QueryParamsResponse, error)

func (*Keeper) HasAsset

func (k *Keeper) HasAsset(ctx sdk.Context, denom string) bool

HasAsset checks if an asset with the given denomination exists in the module's KVStore.

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx sdk.Context, state *v1.GenesisState)

func (*Keeper) IterateAssets

func (k *Keeper) IterateAssets(ctx sdk.Context, fn func(int, v1.Asset) bool)

IterateAssets iterates over all assets stored in the module's KVStore and calls the provided function for each asset. The iteration stops when the provided function returns 'true'.

func (*Keeper) Logger

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

func (*Keeper) OnAcknowledgementPacket

func (k *Keeper) OnAcknowledgementPacket(
	ctx sdk.Context, packet ibcchanneltypes.Packet, ack ibcchanneltypes.Acknowledgement,
) error

OnAcknowledgementPacket processes the acknowledgement packet received after sending an IBC query packet.

func (*Keeper) OnTimeoutPacket

func (k *Keeper) OnTimeoutPacket(ctx sdk.Context, packet ibcchanneltypes.Packet) error

OnTimeoutPacket handles the case when a packet times out before receiving an acknowledgement.

func (*Keeper) SendQueryPacket

func (k *Keeper) SendQueryPacket(
	ctx sdk.Context, channelCap *capabilitytypes.Capability, portID, channelID string, timeout uint64,
	reqs ...abcitypes.RequestQuery,
) (uint64, error)

SendQueryPacket serializes query requests and sends them as an IBC packet to a destination chain.

func (*Keeper) SetAsset

func (k *Keeper) SetAsset(ctx sdk.Context, asset v1.Asset)

SetAsset stores an asset in the module's KVStore.

func (*Keeper) SetDenomForPacket

func (k *Keeper) SetDenomForPacket(ctx sdk.Context, portID, channelID string, sequence uint64, denom string)

SetDenomForPacket stores a denomination for a packet in the module's KVStore.

func (*Keeper) SetParams

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

SetParams stores the oracle module parameters in the module's KVStore.

func (*Keeper) Store

func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore

Jump to

Keyboard shortcuts

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