keeper

package
v1.2.2-dev Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: AGPL-3.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteLimit

func ExecuteLimit(k msgServer, ctx sdk.Context, denomAsk string, denomBid string, memberAsk types.Member, memberBid types.Member) (types.Member, types.Member, error)

func ExecuteOverlap added in v0.1.2

func ExecuteOverlap(k msgServer, ctx sdk.Context, denomAsk string, denomBid string, memberAsk types.Member, memberBid types.Member) (types.Member, types.Member, error)

func ExecuteStop

func ExecuteStop(k msgServer, ctx sdk.Context, denomAsk string, denomBid string, memberAsk types.Member, memberBid types.Member) (types.Member, types.Member, error)

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	ps paramtypes.Subspace,

	bankKeeper types.BankKeeper,
) *Keeper

func (Keeper) AddBurned added in v0.1.4

func (k Keeper) AddBurned(ctx sdk.Context, amount sdk.Int) (burned types.Burned)

SetBurned set the amount of NOM Burned by ONEX

func (Keeper) Book

func (Keeper) BookEnds

func (k Keeper) BookEnds(
	ctx sdk.Context,
	denomA string,
	denomB string,
	orderType string,
	rate []sdk.Int,
) (ends [2]uint64)

BookEnds returns adjacent orders determined by rate

func (Keeper) Bookends

func (Keeper) Burn added in v0.1.4

func (k Keeper) Burn(ctx sdk.Context, profit sdk.Int, member types.Member) (types.Member, error)

func (Keeper) BurnCoin

func (k Keeper) BurnCoin(ctx sdk.Context) (res string)

BurnCoin - the burn coin

func (Keeper) BurnRate

func (k Keeper) BurnRate(ctx sdk.Context) (res string)

BurnRate - the burning rate of the burn coin

func (Keeper) BurnTrade added in v0.1.4

func (k Keeper) BurnTrade(ctx sdk.Context, burnings types.Burnings) (types.Burnings, error)

Input Burnings - Output New Burnings

func (Keeper) Burned added in v0.1.4

func (Keeper) DenomMetadataProposal added in v1.1.2

func (k Keeper) DenomMetadataProposal(ctx sdk.Context, request *types.DenomMetadataProposal) error

DenomMetadataProposal submition.

func (Keeper) Drop

func (Keeper) DropAll

func (Keeper) DropsToCoins added in v0.1.1

func (Keeper) EarnRates

func (k Keeper) EarnRates(ctx sdk.Context) (res string)

EarnRate - the earning rate of the pool leader

func (Keeper) GetAllBurnings

func (k Keeper) GetAllBurnings(ctx sdk.Context) (list []types.Burnings)

GetAllBurnings returns all burnings

func (Keeper) GetAllDrop

func (k Keeper) GetAllDrop(ctx sdk.Context) (list []types.Drop)

GetAllDrop returns all drop

func (Keeper) GetAllMember

func (k Keeper) GetAllMember(ctx sdk.Context) (list []types.Member)

GetAllMember returns all member

func (Keeper) GetAllOrder

func (k Keeper) GetAllOrder(ctx sdk.Context) (list []types.Order)

GetAllOrder returns all order

func (Keeper) GetAllPool

func (k Keeper) GetAllPool(ctx sdk.Context) (list []types.Pool)

GetAllPool returns all pool

func (Keeper) GetAllVolumes added in v1.1.0

func (k Keeper) GetAllVolumes(ctx sdk.Context) (list []types.Volume)

GetAllVolume returns all volumes

func (Keeper) GetBook

func (k Keeper) GetBook(
	ctx sdk.Context,
	denomA string,
	denomB string,
	orderType string,
) (list []types.OrderResponse)

GetOrder returns a order from its index

func (Keeper) GetBurned added in v0.1.4

func (k Keeper) GetBurned(ctx sdk.Context) (burned types.Burned)

GetBurned get the amount of NOM Burned by ONEX

func (Keeper) GetBurnings

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

) (val types.Burnings, found bool)

GetBurnings returns a burnings from its index

func (Keeper) GetDrop

func (k Keeper) GetDrop(
	ctx sdk.Context,
	uid uint64,
) (val types.Drop, found bool)

GetDrop returns a drop from its index

func (Keeper) GetDropAmounts

func (k Keeper) GetDropAmounts(
	ctx sdk.Context,
	uid uint64,
) (denom1 string, denom2 string, amount1 sdk.Int, amount2 sdk.Int, found bool)

GetOrderOwner returns orders from a single owner

func (Keeper) GetDropCoin

func (k Keeper) GetDropCoin(
	ctx sdk.Context,
	denomA string,
	denomB string,
	amountA sdk.Int,
) (amountB sdk.Int, drops sdk.Int, found bool)

GetOrderOwner returns orders from a single owner

func (Keeper) GetDropOwnerPair

func (k Keeper) GetDropOwnerPair(
	ctx sdk.Context,
	owner string,
	pair string,
) (list []types.Drop, found bool)

GetOrderOwner returns orders from a single owner

func (Keeper) GetDropPairs

func (k Keeper) GetDropPairs(
	ctx sdk.Context,
	address string,
) (val types.DropPairs, found bool)

GetDrop returns a drop from its index

func (Keeper) GetDropsOwnerPair

func (k Keeper) GetDropsOwnerPair(
	ctx sdk.Context,
	owner string,
	pair string,
) (drops types.Drops, found bool)

GetOwnerDrops returns drops from a single owner

func (Keeper) GetDropsOwnerPairDetail

func (k Keeper) GetDropsOwnerPairDetail(
	ctx sdk.Context,
	owner string,
	pair string,
) (list []types.Drop)

GetOwnerDrops returns drops from a single owner

func (Keeper) GetDropsToCoins added in v0.1.1

func (k Keeper) GetDropsToCoins(
	ctx sdk.Context,
	denom1 string,
	denom2 string,
	drops string,
) (amount1 sdk.Int, amount2 sdk.Int, err error)

GetOrderOwner returns orders from a single owner

func (Keeper) GetHistory

func (k Keeper) GetHistory(
	ctx sdk.Context,
	pair string,
	length string,
) (list []types.OrderResponse, found bool)

GetHistory returns history of pool trades

func (Keeper) GetMember

func (k Keeper) GetMember(
	ctx sdk.Context,
	denomA string,
	denomB string,

) (val types.Member, found bool)

GetMember returns a member from its index

func (Keeper) GetMemberWithPair

func (k Keeper) GetMemberWithPair(
	ctx sdk.Context,
	pair string,
	denomA string,
	denomB string,

) (val types.Member, found bool)

func (Keeper) GetOrder

func (k Keeper) GetOrder(
	ctx sdk.Context,
	uid uint64,
) (val types.Order, found bool)

GetOrder returns a order from its index

func (Keeper) GetOrderOwner

func (k Keeper) GetOrderOwner(
	ctx sdk.Context,
	owner string,
) (list []types.Order)

GetOrderOwner returns orders from a single owner

func (Keeper) GetOrderOwnerUids

func (k Keeper) GetOrderOwnerUids(
	ctx sdk.Context,
	owner string,
) (orders types.Orders)

GetOrderOwner returns order uids from a single owner

func (Keeper) GetPairs

func (k Keeper) GetPairs(
	ctx sdk.Context,
	owner string,
) (pairs types.DropPairs, found bool)

GetOwnerDrops returns drops from a single owner

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPool

func (k Keeper) GetPool(
	ctx sdk.Context,
	pair string,
) (val types.Pool, found bool)

GetPool returns a pool from its index

func (Keeper) GetQuote added in v0.1.2

func (k Keeper) GetQuote(
	ctx sdk.Context,
	memberAsk types.Member,
	memberBid types.Member,
	denomAmount string,
	amount sdk.Int,
) (string, sdk.Int, error)

BookEnds returns adjacent orders determined by rate

func (Keeper) GetUidCount

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

GetUidCount get the next uid

func (Keeper) GetVolume added in v1.1.0

func (k Keeper) GetVolume(
	ctx sdk.Context,
	denom string,
) (val types.Volume, found bool)

GetVolume returns a volume from its index

func (Keeper) IncVolume added in v1.1.0

func (k Keeper) IncVolume(
	ctx sdk.Context,
	denom string,
	amount sdk.Int,
) types.Volume

GetVolume returns a volume from its index

func (Keeper) Logger

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

func (Keeper) Order

func (Keeper) OrderAll

func (Keeper) Params

func (Keeper) Payout added in v0.1.4

func (k Keeper) Payout(ctx sdk.Context, profit sdk.Int, member types.Member, pool types.Pool) (types.Member, error)

func (Keeper) Profit added in v0.1.4

func (k Keeper) Profit(productBeg sdk.Int, memberA types.Member, memberB types.Member) (profitA sdk.Int, profitB sdk.Int, err error)

func (Keeper) Quote added in v0.1.2

func (Keeper) RemoveBurnings

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

)

RemoveBurnings removes a burnings from the store

func (Keeper) RemoveDrop

func (k Keeper) RemoveDrop(
	ctx sdk.Context,
	uid uint64,
)

RemoveDrop removes a drop from the store

func (Keeper) RemoveDropOwner

func (k Keeper) RemoveDropOwner(
	ctx sdk.Context,
	drop types.Drop,
) error

RemoveDrop removes a drop from the store

func (Keeper) RemoveMember

func (k Keeper) RemoveMember(
	ctx sdk.Context,
	denomA string,
	denomB string,

)

RemoveMember removes a member from the store

func (Keeper) RemoveOrder

func (k Keeper) RemoveOrder(
	ctx sdk.Context,
	uid uint64,
)

RemoveOrder removes a order from the store

func (Keeper) RemoveOrderOwner

func (k Keeper) RemoveOrderOwner(
	ctx sdk.Context,
	owner string,
	uid uint64,
)

RemoveOrderOwner removes an order from owner's open orders

func (Keeper) RemovePool

func (k Keeper) RemovePool(
	ctx sdk.Context,
	pair string,
)

RemovePool removes a pool from the store

func (Keeper) RemoveVolume added in v1.1.0

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

RemoveVolume removes a volume from the store

func (Keeper) SetBurnings

func (k Keeper) SetBurnings(ctx sdk.Context, burnings types.Burnings)

SetBurnings set a specific burnings in the store from its index

func (Keeper) SetDrop

func (k Keeper) SetDrop(ctx sdk.Context, drop types.Drop)

SetDrop set a specific drop in the store from its index

func (Keeper) SetDropOwner

func (k Keeper) SetDropOwner(
	ctx sdk.Context,
	drop types.Drop,
)

SetDrop set a specific drop in the store from its index

func (Keeper) SetMember

func (k Keeper) SetMember(ctx sdk.Context, member types.Member)

SetMember set a specific member in the store from its index

func (Keeper) SetOrder

func (k Keeper) SetOrder(ctx sdk.Context, order types.Order)

SetOrder set a specific order in the store from its index

func (Keeper) SetOrderOwner

func (k Keeper) SetOrderOwner(
	ctx sdk.Context,
	owner string,
	uid uint64,
)

SetOrderOwner adds an order to owner's open orders

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPool

func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool)

SetPool set a specific pool in the store from its index

func (Keeper) SetUidCount

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

SetUidCount set the next uid

func (Keeper) SetVolume added in v1.1.0

func (k Keeper) SetVolume(ctx sdk.Context, volume types.Volume)

SetVolume set a specific volume in the store from its index

func (Keeper) Volume added in v1.1.0

func (Keeper) VolumeAll added in v1.1.0

Jump to

Keyboard shortcuts

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