Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) CancelSwapBatch(ctx sdk.Context, msg *types.MsgCancelSwapBatch) error
- func (k Keeper) CancelSwapRequest(ctx sdk.Context, req types.SwapRequest)
- func (k Keeper) CreatePair(ctx sdk.Context, xCoinDenom, yCoinDenom string) types.Pair
- func (k Keeper) CreatePool(ctx sdk.Context, msg *types.MsgCreatePool) error
- func (k Keeper) DeleteCancelSwapRequest(ctx sdk.Context, pairId, id uint64)
- func (k Keeper) DeleteCancelSwapRequestsToBeDeleted(ctx sdk.Context)
- func (k Keeper) DeleteDepositRequest(ctx sdk.Context, poolId, id uint64)
- 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) error
- func (k Keeper) ExecuteCancelSwapRequest(ctx sdk.Context, req types.CancelSwapRequest)
- 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) ExecuteWithdrawRequest(ctx sdk.Context, req types.WithdrawRequest) error
- func (k Keeper) GetAllPairs(ctx sdk.Context) (pairs []types.Pair)
- func (k Keeper) GetAllPools(ctx sdk.Context) (pools []types.Pool)
- 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) GetNextCancelSwapRequestIdWithUpdate(ctx sdk.Context, pair types.Pair) 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, denomX, denomY 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) (rx sdk.Int, ry sdk.Int)
- func (k Keeper) GetPoolByReserveAcc(ctx sdk.Context, reserveAcc 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) IterateAllCancelSwapRequests(ctx sdk.Context, cb func(req types.CancelSwapRequest) (stop bool))
- func (k Keeper) IterateAllDepositRequests(ctx sdk.Context, cb func(req types.DepositRequest) (stop bool))
- func (k Keeper) IterateAllPairs(ctx sdk.Context, cb func(pair types.Pair) (stop bool))
- func (k Keeper) IterateAllPools(ctx sdk.Context, cb func(pool types.Pool) (stop bool))
- func (k Keeper) IterateAllSwapRequests(ctx sdk.Context, cb func(req types.SwapRequest) (stop bool))
- func (k Keeper) IterateAllWithdrawRequests(ctx sdk.Context, cb func(req types.WithdrawRequest) (stop bool))
- func (k Keeper) IterateCancelSwapRequestsToBeDeleted(ctx sdk.Context, cb func(req types.CancelSwapRequest) (stop bool))
- func (k Keeper) IterateDepositRequestsToBeDeleted(ctx sdk.Context, cb func(req types.DepositRequest) (stop bool))
- func (k Keeper) IteratePairsByDenom(ctx sdk.Context, denom string, cb func(pair types.Pair) (stop bool))
- func (k Keeper) IteratePoolsByPair(ctx sdk.Context, pairId uint64, cb func(pool types.Pool) (stop bool))
- func (k Keeper) IterateSwapRequestsByPair(ctx sdk.Context, pairId uint64, cb func(req types.SwapRequest) (stop bool))
- func (k Keeper) IterateSwapRequestsToBeDeletedByPair(ctx sdk.Context, pairId uint64, cb func(req types.SwapRequest) (stop bool))
- func (k Keeper) IterateWithdrawRequestsToBeDeleted(ctx sdk.Context, cb func(req types.WithdrawRequest) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MarkCancelSwapRequestToBeDeleted(ctx sdk.Context, req types.CancelSwapRequest, succeeded bool)
- func (k Keeper) RefundAndDeleteDepositRequestsToBeDeleted(ctx sdk.Context)
- func (k Keeper) RefundAndDeleteSwapRequestsToBeDeleted(ctx sdk.Context)
- func (k Keeper) RefundAndDeleteWithdrawRequestsToBeDeleted(ctx sdk.Context)
- func (k Keeper) RefundDepositRequest(ctx sdk.Context, req types.DepositRequest) error
- func (k Keeper) RefundSwapRequest(ctx sdk.Context, pair types.Pair, req types.SwapRequest) error
- func (k Keeper) SetCancelSwapRequest(ctx sdk.Context, req types.CancelSwapRequest)
- 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, denomX, denomY 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) SwapBatch(ctx sdk.Context, msg *types.MsgSwapBatch) error
- func (k Keeper) WithdrawBatch(ctx sdk.Context, msg *types.MsgWithdrawBatch) 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) PoolByReserveAcc(c context.Context, req *types.QueryPoolByReserveAccRequest) (*types.QueryPoolResponse, error)
- func (k Querier) Pools(c context.Context, req *types.QueryPoolsRequest) (*types.QueryPoolsResponse, error)
- func (k Querier) PoolsByPair(c context.Context, req *types.QueryPoolsByPairRequest) (*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) CancelSwapBatch ¶
CancelSwapBatch handles types.MsgCancelSwapBatch and stores it.
func (Keeper) CancelSwapRequest ¶
func (k Keeper) CancelSwapRequest(ctx sdk.Context, req types.SwapRequest)
func (Keeper) CreatePair ¶
CreatePair creates a new pair.
func (Keeper) CreatePool ¶
CreatePool handles types.MsgCreatePool and creates a pool.
func (Keeper) DeleteCancelSwapRequest ¶
DeleteCancelSwapRequest deletes a cancel swap request.
func (Keeper) DeleteCancelSwapRequestsToBeDeleted ¶
func (Keeper) DeleteDepositRequest ¶
DeleteDepositRequest deletes a deposit request.
func (Keeper) DeleteSwapRequest ¶
DeleteSwapRequest deletes a swap request.
func (Keeper) DeleteWithdrawRequest ¶
DeleteWithdrawRequest deletes a withdraw request.
func (Keeper) DepositBatch ¶
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 ¶
ExecuteDepositRequest executes a deposit request.
func (Keeper) ExecuteMatching ¶
func (Keeper) ExecuteWithdrawRequest ¶
ExecuteWithdrawRequest executes a withdraw request.
func (Keeper) GetAllPairs ¶
GetAllPairs returns all pairs in the store.
func (Keeper) GetAllPools ¶
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 ¶
GetLastPairId returns the last pair id.
func (Keeper) GetLastPoolId ¶
GetLastPoolId returns the last pool id.
func (Keeper) GetNextCancelSwapRequestIdWithUpdate ¶
GetNextCancelSwapRequestIdWithUpdate increments the pair's last cancel swap request id and returns it.
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, denomX, denomY string) (pair types.Pair, found bool)
GetPairByDenoms returns a types.Pair for given denoms.
func (Keeper) GetPoolBalance ¶
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 ¶
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 (Keeper) IterateAllDepositRequests ¶
func (Keeper) IterateAllPairs ¶
IterateAllPairs iterates over all the stored pairs and performs a callback function. Stops iteration when callback returns true.
func (Keeper) IterateAllPools ¶
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) IterateCancelSwapRequestsToBeDeleted ¶
func (Keeper) IterateDepositRequestsToBeDeleted ¶
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 (Keeper) IterateSwapRequestsToBeDeletedByPair ¶
func (Keeper) IterateWithdrawRequestsToBeDeleted ¶
func (Keeper) MarkCancelSwapRequestToBeDeleted ¶
func (Keeper) RefundAndDeleteDepositRequestsToBeDeleted ¶
func (Keeper) RefundAndDeleteSwapRequestsToBeDeleted ¶
func (Keeper) RefundAndDeleteWithdrawRequestsToBeDeleted ¶
func (Keeper) RefundDepositRequest ¶
func (Keeper) RefundSwapRequest ¶
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 ¶
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 ¶
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) PoolByReserveAcc ¶
func (k Querier) PoolByReserveAcc(c context.Context, req *types.QueryPoolByReserveAccRequest) (*types.QueryPoolResponse, error)
PoolByReserveAcc 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) PoolsByPair ¶
func (k Querier) PoolsByPair(c context.Context, req *types.QueryPoolsByPairRequest) (*types.QueryPoolsResponse, error)
PoolsByPair queries all pools that correspond to the pair.
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.