keeper

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 sdk.StoreKey,
	paramSpace paramstypes.Subspace,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
) Keeper

func (Keeper) CancelSwapBatch

func (k Keeper) CancelSwapBatch(ctx sdk.Context, msg *types.MsgCancelSwapBatch) error

CancelSwapBatch handles types.MsgCancelSwapBatch and stores it.

func (Keeper) CancelSwapRequest

func (k Keeper) CancelSwapRequest(ctx sdk.Context, req types.SwapRequest)

func (Keeper) CreatePair

func (k Keeper) CreatePair(ctx sdk.Context, xCoinDenom, yCoinDenom string) types.Pair

CreatePair creates a new pair.

func (Keeper) CreatePool

func (k Keeper) CreatePool(ctx sdk.Context, msg *types.MsgCreatePool) error

CreatePool handles types.MsgCreatePool and creates a pool.

func (Keeper) DeleteCancelSwapRequest

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

DeleteCancelSwapRequest deletes a cancel swap request.

func (Keeper) DeleteCancelSwapRequestsToBeDeleted

func (k Keeper) DeleteCancelSwapRequestsToBeDeleted(ctx sdk.Context)

func (Keeper) DeleteDepositRequest

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

DeleteDepositRequest deletes a deposit request.

func (Keeper) DeleteSwapRequest

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

DeleteSwapRequest deletes a swap request.

func (Keeper) DeleteWithdrawRequest

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

DeleteWithdrawRequest deletes a withdraw request.

func (Keeper) DepositBatch

func (k Keeper) DepositBatch(ctx sdk.Context, msg *types.MsgDepositBatch) error

DepositBatch handles types.MsgDepositBatch and stores the request.

func (Keeper) ExecuteCancelSwapRequest

func (k Keeper) ExecuteCancelSwapRequest(ctx sdk.Context, req types.CancelSwapRequest)

ExecuteCancelSwapRequest cancels swap requests and deletes cancel swap requests.

func (Keeper) ExecuteDepositRequest

func (k Keeper) ExecuteDepositRequest(ctx sdk.Context, req types.DepositRequest) error

ExecuteDepositRequest executes a deposit request.

func (Keeper) ExecuteMatching

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

func (Keeper) ExecuteWithdrawRequest

func (k Keeper) ExecuteWithdrawRequest(ctx sdk.Context, req types.WithdrawRequest) error

ExecuteWithdrawRequest executes a withdraw request.

func (Keeper) GetAllPairs

func (k Keeper) GetAllPairs(ctx sdk.Context) (pairs []types.Pair)

GetAllPairs returns all pairs in the store.

func (Keeper) GetAllPools

func (k Keeper) GetAllPools(ctx sdk.Context) (pools []types.Pool)

GetAllPools returns all pairs in the store.

func (Keeper) GetDepositRequest

func (k Keeper) GetDepositRequest(ctx sdk.Context, poolId, id uint64) (state types.DepositRequest, found bool)

GetDepositRequest returns the particular deposit request.

func (Keeper) GetLastPairId

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

GetLastPairId returns the last pair id.

func (Keeper) GetLastPoolId

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

GetLastPoolId returns the last pool id.

func (Keeper) GetNextCancelSwapRequestIdWithUpdate

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

GetNextCancelSwapRequestIdWithUpdate increments the pair's last cancel swap request id and returns it.

func (Keeper) GetNextDepositRequestIdWithUpdate

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

GetNextDepositRequestIdWithUpdate increments the pool's last deposit request id and returns it.

func (Keeper) GetNextPairIdWithUpdate

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

GetNextPairIdWithUpdate increments pair id by one and set it.

func (Keeper) GetNextPoolIdWithUpdate

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

GetNextPoolIdWithUpdate increments pool id by one and set it.

func (Keeper) GetNextSwapRequestIdWithUpdate

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

GetNextSwapRequestIdWithUpdate increments the pair's last swap request id and returns it.

func (Keeper) GetNextWithdrawRequestIdWithUpdate

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

GetNextWithdrawRequestIdWithUpdate increments the pool's last withdraw request id and returns it.

func (Keeper) GetPair

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

GetPair returns pair object for the given pair id.

func (Keeper) GetPairByDenoms

func (k Keeper) GetPairByDenoms(ctx sdk.Context, denomX, denomY string) (pair types.Pair, found bool)

GetPairByDenoms returns a types.Pair for given denoms.

func (Keeper) GetParams

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

func (Keeper) GetPool

func (k Keeper) GetPool(ctx sdk.Context, id uint64) (pool types.Pool, found bool)

GetPool returns pool object for the given pool id.

func (Keeper) GetPoolBalance

func (k Keeper) GetPoolBalance(ctx sdk.Context, pool types.Pool) (rx sdk.Int, ry sdk.Int)

GetPoolBalance returns x coin and y coin balance of the pool.

func (Keeper) GetPoolByReserveAcc

func (k Keeper) GetPoolByReserveAcc(ctx sdk.Context, reserveAcc sdk.AccAddress) (pool types.Pool, found bool)

GetPoolByReserveAcc returns pool object for the givern reserve account address.

func (Keeper) GetPoolCoinSupply

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

GetPoolCoinSupply returns total pool coin supply of the pool.

func (Keeper) GetSwapRequest

func (k Keeper) GetSwapRequest(ctx sdk.Context, pairId, id uint64) (state types.SwapRequest, found bool)

GetSwapRequest returns the particular swap request.

func (Keeper) GetWithdrawRequest

func (k Keeper) GetWithdrawRequest(ctx sdk.Context, poolId, id uint64) (state types.WithdrawRequest, found bool)

GetWithdrawRequest returns the particular withdraw request.

func (Keeper) IterateAllCancelSwapRequests

func (k Keeper) IterateAllCancelSwapRequests(ctx sdk.Context, cb func(req types.CancelSwapRequest) (stop bool))

func (Keeper) IterateAllDepositRequests

func (k Keeper) IterateAllDepositRequests(ctx sdk.Context, cb func(req types.DepositRequest) (stop bool))

func (Keeper) IterateAllPairs

func (k Keeper) IterateAllPairs(ctx sdk.Context, cb func(pair types.Pair) (stop bool))

IterateAllPairs iterates over all the stored pairs and performs a callback function. Stops iteration when callback returns true.

func (Keeper) IterateAllPools

func (k Keeper) IterateAllPools(ctx sdk.Context, cb func(pool types.Pool) (stop bool))

IterateAllPools iterates over all the stored pools and performs a callback function. Stops iteration when callback returns true.

func (Keeper) IterateAllSwapRequests

func (k Keeper) IterateAllSwapRequests(ctx sdk.Context, cb func(req types.SwapRequest) (stop bool))

func (Keeper) IterateAllWithdrawRequests

func (k Keeper) IterateAllWithdrawRequests(ctx sdk.Context, cb func(req types.WithdrawRequest) (stop bool))

func (Keeper) IterateCancelSwapRequestsToBeDeleted

func (k Keeper) IterateCancelSwapRequestsToBeDeleted(ctx sdk.Context, cb func(req types.CancelSwapRequest) (stop bool))

func (Keeper) IterateDepositRequestsToBeDeleted

func (k Keeper) IterateDepositRequestsToBeDeleted(ctx sdk.Context, cb func(req types.DepositRequest) (stop bool))

func (Keeper) IteratePairsByDenom

func (k Keeper) IteratePairsByDenom(ctx sdk.Context, denom string, cb func(pair types.Pair) (stop bool))

IteratePairsByDenom iterates over all the stored pairs by particular denomination and performs a callback function. Stops iteration when callback returns true.

func (Keeper) IteratePoolsByPair

func (k Keeper) IteratePoolsByPair(ctx sdk.Context, pairId uint64, cb func(pool types.Pool) (stop bool))

IterateAllPools iterates over all the stored pools by the pair and performs a callback function. Stops iteration when callback returns true.

func (Keeper) IterateSwapRequestsByPair

func (k Keeper) IterateSwapRequestsByPair(ctx sdk.Context, pairId uint64, cb func(req types.SwapRequest) (stop bool))

func (Keeper) IterateSwapRequestsToBeDeletedByPair

func (k Keeper) IterateSwapRequestsToBeDeletedByPair(ctx sdk.Context, pairId uint64, cb func(req types.SwapRequest) (stop bool))

func (Keeper) IterateWithdrawRequestsToBeDeleted

func (k Keeper) IterateWithdrawRequestsToBeDeleted(ctx sdk.Context, cb func(req types.WithdrawRequest) (stop bool))

func (Keeper) Logger

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

func (Keeper) MarkCancelSwapRequestToBeDeleted

func (k Keeper) MarkCancelSwapRequestToBeDeleted(ctx sdk.Context, req types.CancelSwapRequest, succeeded bool)

func (Keeper) RefundAndDeleteDepositRequestsToBeDeleted

func (k Keeper) RefundAndDeleteDepositRequestsToBeDeleted(ctx sdk.Context)

func (Keeper) RefundAndDeleteSwapRequestsToBeDeleted

func (k Keeper) RefundAndDeleteSwapRequestsToBeDeleted(ctx sdk.Context)

func (Keeper) RefundAndDeleteWithdrawRequestsToBeDeleted

func (k Keeper) RefundAndDeleteWithdrawRequestsToBeDeleted(ctx sdk.Context)

func (Keeper) RefundDepositRequest

func (k Keeper) RefundDepositRequest(ctx sdk.Context, req types.DepositRequest) error

func (Keeper) RefundSwapRequest

func (k Keeper) RefundSwapRequest(ctx sdk.Context, pair types.Pair, req types.SwapRequest) error

func (Keeper) SetCancelSwapRequest

func (k Keeper) SetCancelSwapRequest(ctx sdk.Context, req types.CancelSwapRequest)

SetCancelSwapRequest stores types.CancelSwapRequest for the batch execution.

func (Keeper) SetDepositRequest

func (k Keeper) SetDepositRequest(ctx sdk.Context, req types.DepositRequest)

SetDepositRequest stores deposit request for the batch execution.

func (Keeper) SetLastPairId

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

SetLastPairId stores the last pair id.

func (Keeper) SetLastPoolId

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

SetLastPoolId stores the last pool id.

func (Keeper) SetPair

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

SetPair stores the particular pair.

func (Keeper) SetPairIndex

func (k Keeper) SetPairIndex(ctx sdk.Context, denomX, denomY string, pairId uint64)

SetPairIndex stores a pair index.

func (Keeper) SetPairLookupIndex

func (k Keeper) SetPairLookupIndex(ctx sdk.Context, denomA string, denomB string, pairId uint64)

SetPairLookupIndex stores a pair lookup index for given denoms.

func (Keeper) SetParams

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

func (Keeper) SetPool

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

SetPool stores the particular pool.

func (Keeper) SetPoolByReserveIndex

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

SetPoolByReserveIndex stores a pool by reserve account index key.

func (Keeper) SetPoolsByPairIndex

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

SetPoolsByPairIndex stores a pool by pair index key.

func (Keeper) SetSwapRequest

func (k Keeper) SetSwapRequest(ctx sdk.Context, req types.SwapRequest)

SetSwapRequest stores swap request for the batch execution.

func (Keeper) SetWithdrawRequest

func (k Keeper) SetWithdrawRequest(ctx sdk.Context, req types.WithdrawRequest)

SetWithdrawRequest stores withdraw request for the batch execution.

func (Keeper) SwapBatch

func (k Keeper) SwapBatch(ctx sdk.Context, msg *types.MsgSwapBatch) error

SwapBatch handles types.MsgSwapBatch and stores it.

func (Keeper) WithdrawBatch

func (k Keeper) WithdrawBatch(ctx sdk.Context, msg *types.MsgWithdrawBatch) error

WithdrawBatch handles types.MsgWithdrawBatch and stores the request.

type Querier

type Querier struct {
	Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.

func (Querier) DepositRequest

DepositRequest quereis the specific deposit request.

func (Querier) DepositRequests

DepositRequests queries all deposit requests.

func (Querier) Pair

Pair queries the specific pair.

func (Querier) Pairs

Pairs queries all pairs.

func (Querier) Params

Params queries the parameters of the liquidity module.

func (Querier) Pool

Pool queries the specific pool.

func (Querier) PoolByPoolCoinDenom

PoolByPoolCoinDenom queries the specific pool by the pool coin denomination.

func (Querier) PoolByReserveAcc

PoolByReserveAcc queries the specific pool by the reserve account address.

func (Querier) Pools

Pools queries all pools.

func (Querier) PoolsByPair

PoolsByPair queries all pools that correspond to the pair.

func (Querier) SwapRequest

SwapRequest queries the specific swap request.

func (Querier) SwapRequests

SwapRequests queries all swap requests.

func (Querier) WithdrawRequest

WithdrawRequest quereis the specific withdraw request.

func (Querier) WithdrawRequests

WithdrawRequests quereis all withdraw requests.

Jump to

Keyboard shortcuts

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