Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) CancelAllOrders(ctx sdk.Context, msg *types.MsgCancelAllOrders) error
- func (k Keeper) CancelOrder(ctx sdk.Context, msg *types.MsgCancelOrder) error
- func (k Keeper) CreatePair(ctx sdk.Context, msg *types.MsgCreatePair) (types.Pair, error)
- func (k Keeper) CreatePool(ctx sdk.Context, msg *types.MsgCreatePool) (types.Pool, error)
- func (k Keeper) DeleteDepositRequest(ctx sdk.Context, poolId, id uint64)
- func (k Keeper) DeleteOutdatedRequests(ctx sdk.Context)
- func (k Keeper) DeleteSwapRequest(ctx sdk.Context, pairId, id uint64)
- func (k Keeper) DeleteWithdrawRequest(ctx sdk.Context, poolId, id uint64)
- func (k Keeper) DepositBatch(ctx sdk.Context, msg *types.MsgDepositBatch) (types.DepositRequest, error)
- func (k Keeper) ExecuteDepositRequest(ctx sdk.Context, req types.DepositRequest) error
- func (k Keeper) ExecuteMatching(ctx sdk.Context, pair types.Pair) error
- func (k Keeper) ExecuteRequests(ctx sdk.Context)
- func (k Keeper) ExecuteWithdrawRequest(ctx sdk.Context, req types.WithdrawRequest) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FailWithdrawRequest(ctx sdk.Context, req types.WithdrawRequest)
- func (k Keeper) GetAllDepositRequests(ctx sdk.Context) (reqs []types.DepositRequest)
- func (k Keeper) GetAllPairs(ctx sdk.Context) (pairs []types.Pair)
- func (k Keeper) GetAllPools(ctx sdk.Context) (pools []types.Pool)
- func (k Keeper) GetAllSwapRequests(ctx sdk.Context) (reqs []types.SwapRequest)
- func (k Keeper) GetAllWithdrawRequests(ctx sdk.Context) (reqs []types.WithdrawRequest)
- func (k Keeper) GetDepositRequest(ctx sdk.Context, poolId, id uint64) (state types.DepositRequest, found bool)
- func (k Keeper) GetLastPairId(ctx sdk.Context) uint64
- func (k Keeper) GetLastPoolId(ctx sdk.Context) uint64
- func (k Keeper) GetNextDepositRequestIdWithUpdate(ctx sdk.Context, pool types.Pool) uint64
- func (k Keeper) GetNextPairIdWithUpdate(ctx sdk.Context) uint64
- func (k Keeper) GetNextPoolIdWithUpdate(ctx sdk.Context) uint64
- func (k Keeper) GetNextSwapRequestIdWithUpdate(ctx sdk.Context, pair types.Pair) uint64
- func (k Keeper) GetNextWithdrawRequestIdWithUpdate(ctx sdk.Context, pool types.Pool) uint64
- func (k Keeper) GetPair(ctx sdk.Context, id uint64) (pair types.Pair, found bool)
- func (k Keeper) GetPairByDenoms(ctx sdk.Context, baseCoinDenom, quoteCoinDenom string) (pair types.Pair, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPool(ctx sdk.Context, id uint64) (pool types.Pool, found bool)
- func (k Keeper) GetPoolBalance(ctx sdk.Context, pool types.Pool, pair types.Pair) (rx sdk.Int, ry sdk.Int)
- func (k Keeper) GetPoolByReserveAddress(ctx sdk.Context, reserveAddr sdk.AccAddress) (pool types.Pool, found bool)
- func (k Keeper) GetPoolCoinSupply(ctx sdk.Context, pool types.Pool) sdk.Int
- func (k Keeper) GetSwapRequest(ctx sdk.Context, pairId, id uint64) (state types.SwapRequest, found bool)
- func (k Keeper) GetWithdrawRequest(ctx sdk.Context, poolId, id uint64) (state types.WithdrawRequest, found bool)
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IterateAllDepositRequests(ctx sdk.Context, cb func(req types.DepositRequest) (stop bool, err error)) error
- func (k Keeper) IterateAllPairs(ctx sdk.Context, cb func(pair types.Pair) (stop bool, err error)) error
- func (k Keeper) IterateAllPools(ctx sdk.Context, cb func(pool types.Pool) (stop bool, err error)) error
- func (k Keeper) IterateAllSwapRequests(ctx sdk.Context, cb func(req types.SwapRequest) (stop bool, err error)) error
- func (k Keeper) IterateAllWithdrawRequests(ctx sdk.Context, cb func(req types.WithdrawRequest) (stop bool, err error)) error
- func (k Keeper) IteratePoolsByPair(ctx sdk.Context, pairId uint64, ...) error
- func (k Keeper) IterateSwapRequestsByPair(ctx sdk.Context, pairId uint64, ...) error
- func (k Keeper) LimitOrderBatch(ctx sdk.Context, msg *types.MsgLimitOrderBatch) (types.SwapRequest, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MarkPoolAsDisabled(ctx sdk.Context, pool types.Pool)
- func (k Keeper) MarketOrderBatch(ctx sdk.Context, msg *types.MsgMarketOrderBatch) (types.SwapRequest, error)
- func (k Keeper) RefundDepositRequestAndSetStatus(ctx sdk.Context, req types.DepositRequest, status types.RequestStatus) error
- func (k Keeper) RefundSwapRequest(ctx sdk.Context, req types.SwapRequest) error
- func (k Keeper) RefundSwapRequestAndSetStatus(ctx sdk.Context, req types.SwapRequest, status types.SwapRequestStatus) error
- func (k Keeper) SetDepositRequest(ctx sdk.Context, req types.DepositRequest)
- func (k Keeper) SetLastPairId(ctx sdk.Context, id uint64)
- func (k Keeper) SetLastPoolId(ctx sdk.Context, id uint64)
- func (k Keeper) SetPair(ctx sdk.Context, pair types.Pair)
- func (k Keeper) SetPairIndex(ctx sdk.Context, baseCoinDenom, quoteCoinDenom string, pairId uint64)
- func (k Keeper) SetPairLookupIndex(ctx sdk.Context, denomA string, denomB string, pairId uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool)
- func (k Keeper) SetPoolByReserveIndex(ctx sdk.Context, pool types.Pool)
- func (k Keeper) SetPoolsByPairIndex(ctx sdk.Context, pool types.Pool)
- func (k Keeper) SetSwapRequest(ctx sdk.Context, req types.SwapRequest)
- func (k Keeper) SetWithdrawRequest(ctx sdk.Context, req types.WithdrawRequest)
- func (k Keeper) WithdrawBatch(ctx sdk.Context, msg *types.MsgWithdrawBatch) (types.WithdrawRequest, error)
- type Querier
- func (k Querier) DepositRequest(c context.Context, req *types.QueryDepositRequestRequest) (*types.QueryDepositRequestResponse, error)
- func (k Querier) DepositRequests(c context.Context, req *types.QueryDepositRequestsRequest) (*types.QueryDepositRequestsResponse, error)
- func (k Querier) Pair(c context.Context, req *types.QueryPairRequest) (*types.QueryPairResponse, error)
- func (k Querier) Pairs(c context.Context, req *types.QueryPairsRequest) (*types.QueryPairsResponse, error)
- func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) Pool(c context.Context, req *types.QueryPoolRequest) (*types.QueryPoolResponse, error)
- func (k Querier) PoolByPoolCoinDenom(c context.Context, req *types.QueryPoolByPoolCoinDenomRequest) (*types.QueryPoolResponse, error)
- func (k Querier) PoolByReserveAddress(c context.Context, req *types.QueryPoolByReserveAddressRequest) (*types.QueryPoolResponse, error)
- func (k Querier) Pools(c context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
- func (k Querier) SwapRequest(c context.Context, req *types.QuerySwapRequestRequest) (*types.QuerySwapRequestResponse, error)
- func (k Querier) SwapRequests(c context.Context, req *types.QuerySwapRequestsRequest) (*types.QuerySwapRequestsResponse, error)
- func (k Querier) WithdrawRequest(c context.Context, req *types.QueryWithdrawRequestRequest) (*types.QueryWithdrawRequestResponse, error)
- func (k Querier) WithdrawRequests(c context.Context, req *types.QueryWithdrawRequestsRequest) (*types.QueryWithdrawRequestsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
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) CancelAllOrders ¶
CancelAllOrders handles types.MsgCancelAllOrders and cancels all orders.
func (Keeper) CancelOrder ¶
CancelOrder handles types.MsgCancelOrder and cancels an order.
func (Keeper) CreatePair ¶
CreatePair handles types.MsgCreatePair and creates a pair.
func (Keeper) CreatePool ¶
CreatePool handles types.MsgCreatePool and creates a pool.
func (Keeper) DeleteDepositRequest ¶
DeleteDepositRequest deletes a deposit request.
func (Keeper) DeleteOutdatedRequests ¶
func (Keeper) DeleteSwapRequest ¶
DeleteSwapRequest deletes a swap request.
func (Keeper) DeleteWithdrawRequest ¶
DeleteWithdrawRequest deletes a withdraw request.
func (Keeper) DepositBatch ¶
func (k Keeper) DepositBatch(ctx sdk.Context, msg *types.MsgDepositBatch) (types.DepositRequest, error)
DepositBatch handles types.MsgDepositBatch and stores the request.
func (Keeper) ExecuteDepositRequest ¶
ExecuteDepositRequest executes a deposit request.
func (Keeper) ExecuteMatching ¶
func (Keeper) ExecuteRequests ¶
func (Keeper) ExecuteWithdrawRequest ¶
ExecuteWithdrawRequest executes a withdraw request.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the capability module's exported genesis.
func (Keeper) FailWithdrawRequest ¶
func (k Keeper) FailWithdrawRequest(ctx sdk.Context, req types.WithdrawRequest)
func (Keeper) GetAllDepositRequests ¶
func (k Keeper) GetAllDepositRequests(ctx sdk.Context) (reqs []types.DepositRequest)
func (Keeper) GetAllPairs ¶
GetAllPairs returns all pairs in the store.
func (Keeper) GetAllPools ¶
GetAllPools returns all pairs in the store.
func (Keeper) GetAllSwapRequests ¶
func (k Keeper) GetAllSwapRequests(ctx sdk.Context) (reqs []types.SwapRequest)
func (Keeper) GetAllWithdrawRequests ¶
func (k Keeper) GetAllWithdrawRequests(ctx sdk.Context) (reqs []types.WithdrawRequest)
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 ¶
GetLastPairId returns the last pair id.
func (Keeper) GetLastPoolId ¶
GetLastPoolId returns the last pool id.
func (Keeper) GetNextDepositRequestIdWithUpdate ¶
GetNextDepositRequestIdWithUpdate increments the pool's last deposit request id and returns it.
func (Keeper) GetNextPairIdWithUpdate ¶
GetNextPairIdWithUpdate increments pair id by one and set it.
func (Keeper) GetNextPoolIdWithUpdate ¶
GetNextPoolIdWithUpdate increments pool id by one and set it.
func (Keeper) GetNextSwapRequestIdWithUpdate ¶
GetNextSwapRequestIdWithUpdate increments the pair's last swap request id and returns it.
func (Keeper) GetNextWithdrawRequestIdWithUpdate ¶
GetNextWithdrawRequestIdWithUpdate increments the pool's last withdraw request id and returns it.
func (Keeper) GetPairByDenoms ¶
func (k Keeper) GetPairByDenoms(ctx sdk.Context, baseCoinDenom, quoteCoinDenom string) (pair types.Pair, found bool)
GetPairByDenoms returns a types.Pair for given denoms.
func (Keeper) GetPoolBalance ¶
func (k Keeper) GetPoolBalance(ctx sdk.Context, pool types.Pool, pair types.Pair) (rx sdk.Int, ry sdk.Int)
GetPoolBalance returns x coin and y coin balance of the pool.
func (Keeper) GetPoolByReserveAddress ¶
func (k Keeper) GetPoolByReserveAddress(ctx sdk.Context, reserveAddr sdk.AccAddress) (pool types.Pool, found bool)
GetPoolByReserveAddress returns pool object for the given reserve account address.
func (Keeper) GetPoolCoinSupply ¶
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) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the capability module's state from a provided genesis state.
func (Keeper) IterateAllDepositRequests ¶
func (Keeper) IterateAllPairs ¶
func (k Keeper) IterateAllPairs(ctx sdk.Context, cb func(pair types.Pair) (stop bool, err error)) error
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, err error)) error
IterateAllPools iterates over all the stored pools and performs a callback function. Stops iteration when callback returns true.
func (Keeper) IterateAllSwapRequests ¶
func (Keeper) IterateAllWithdrawRequests ¶
func (Keeper) IteratePoolsByPair ¶
func (k Keeper) IteratePoolsByPair(ctx sdk.Context, pairId uint64, cb func(pool types.Pool) (stop bool, err error)) error
IteratePoolsByPair iterates over all the stored pools by the pair and performs a callback function. Stops iteration when callback returns true.
func (Keeper) IterateSwapRequestsByPair ¶
func (Keeper) LimitOrderBatch ¶
func (k Keeper) LimitOrderBatch(ctx sdk.Context, msg *types.MsgLimitOrderBatch) (types.SwapRequest, error)
LimitOrderBatch handles types.MsgLimitOrderBatch and stores it.
func (Keeper) MarkPoolAsDisabled ¶
func (Keeper) MarketOrderBatch ¶
func (k Keeper) MarketOrderBatch(ctx sdk.Context, msg *types.MsgMarketOrderBatch) (types.SwapRequest, error)
MarketOrderBatch handles types.MsgMarketOrderBatch and stores it.
func (Keeper) RefundDepositRequestAndSetStatus ¶
func (k Keeper) RefundDepositRequestAndSetStatus(ctx sdk.Context, req types.DepositRequest, status types.RequestStatus) error
func (Keeper) RefundSwapRequest ¶
func (Keeper) RefundSwapRequestAndSetStatus ¶
func (k Keeper) RefundSwapRequestAndSetStatus(ctx sdk.Context, req types.SwapRequest, status types.SwapRequestStatus) error
func (Keeper) SetDepositRequest ¶
func (k Keeper) SetDepositRequest(ctx sdk.Context, req types.DepositRequest)
SetDepositRequest stores deposit request for the batch execution.
func (Keeper) SetLastPairId ¶
SetLastPairId stores the last pair id.
func (Keeper) SetLastPoolId ¶
SetLastPoolId stores the last pool id.
func (Keeper) SetPairIndex ¶
SetPairIndex stores a pair index.
func (Keeper) SetPairLookupIndex ¶
SetPairLookupIndex stores a pair lookup index for given denoms.
func (Keeper) SetPoolByReserveIndex ¶
SetPoolByReserveIndex stores a pool by reserve account index key.
func (Keeper) SetPoolsByPairIndex ¶
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) WithdrawBatch ¶
func (k Keeper) WithdrawBatch(ctx sdk.Context, msg *types.MsgWithdrawBatch) (types.WithdrawRequest, 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 ¶
func (k Querier) DepositRequest(c context.Context, req *types.QueryDepositRequestRequest) (*types.QueryDepositRequestResponse, error)
DepositRequest quereis the specific deposit request.
func (Querier) DepositRequests ¶
func (k Querier) DepositRequests(c context.Context, req *types.QueryDepositRequestsRequest) (*types.QueryDepositRequestsResponse, error)
DepositRequests queries all deposit requests.
func (Querier) Pair ¶
func (k Querier) Pair(c context.Context, req *types.QueryPairRequest) (*types.QueryPairResponse, error)
Pair queries the specific pair.
func (Querier) Pairs ¶
func (k Querier) Pairs(c context.Context, req *types.QueryPairsRequest) (*types.QueryPairsResponse, error)
Pairs queries all pairs.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the parameters of the liquidity module.
func (Querier) Pool ¶
func (k Querier) Pool(c context.Context, req *types.QueryPoolRequest) (*types.QueryPoolResponse, error)
Pool queries the specific pool.
func (Querier) PoolByPoolCoinDenom ¶
func (k Querier) PoolByPoolCoinDenom(c context.Context, req *types.QueryPoolByPoolCoinDenomRequest) (*types.QueryPoolResponse, error)
PoolByPoolCoinDenom queries the specific pool by the pool coin denomination.
func (Querier) PoolByReserveAddress ¶
func (k Querier) PoolByReserveAddress(c context.Context, req *types.QueryPoolByReserveAddressRequest) (*types.QueryPoolResponse, error)
PoolByReserveAddress queries the specific pool by the reserve account address.
func (Querier) Pools ¶
func (k Querier) Pools(c context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
Pools queries all pools.
func (Querier) SwapRequest ¶
func (k Querier) SwapRequest(c context.Context, req *types.QuerySwapRequestRequest) (*types.QuerySwapRequestResponse, error)
SwapRequest queries the specific swap request.
func (Querier) SwapRequests ¶
func (k Querier) SwapRequests(c context.Context, req *types.QuerySwapRequestsRequest) (*types.QuerySwapRequestsResponse, error)
SwapRequests queries all swap requests.
func (Querier) WithdrawRequest ¶
func (k Querier) WithdrawRequest(c context.Context, req *types.QueryWithdrawRequestRequest) (*types.QueryWithdrawRequestResponse, error)
WithdrawRequest quereis the specific withdraw request.
func (Querier) WithdrawRequests ¶
func (k Querier) WithdrawRequests(c context.Context, req *types.QueryWithdrawRequestsRequest) (*types.QueryWithdrawRequestsResponse, error)
WithdrawRequests quereis all withdraw requests.