Documentation ¶
Index ¶
- type EscrowKeeper
- type IKeeper
- type Keeper
- func (k Keeper) BidCountForOrder(ctx sdk.Context, id types.OrderID) uint32
- func (k Keeper) Codec() codec.BinaryCodec
- func (k Keeper) CreateBid(ctx sdk.Context, oid types.OrderID, provider sdk.AccAddress, price sdk.DecCoin) (types.Bid, error)
- func (k Keeper) CreateLease(ctx sdk.Context, bid types.Bid)
- func (k Keeper) CreateOrder(ctx sdk.Context, gid dtypes.GroupID, spec dtypes.GroupSpec) (types.Order, error)
- func (k Keeper) GetBid(ctx sdk.Context, id types.BidID) (types.Bid, bool)
- func (k Keeper) GetLease(ctx sdk.Context, id types.LeaseID) (types.Lease, bool)
- func (k Keeper) GetOrder(ctx sdk.Context, id types.OrderID) (types.Order, bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) LeaseForOrder(ctx sdk.Context, oid types.OrderID) (types.Lease, bool)
- func (k Keeper) NewQuerier() Querier
- func (k Keeper) OnBidClosed(ctx sdk.Context, bid types.Bid)
- func (k Keeper) OnBidLost(ctx sdk.Context, bid types.Bid)
- func (k Keeper) OnBidMatched(ctx sdk.Context, bid types.Bid)
- func (k Keeper) OnGroupClosed(ctx sdk.Context, id dtypes.GroupID)
- func (k Keeper) OnLeaseClosed(ctx sdk.Context, lease types.Lease, state types.Lease_State)
- func (k Keeper) OnOrderClosed(ctx sdk.Context, order types.Order)
- func (k Keeper) OnOrderMatched(ctx sdk.Context, order types.Order)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) StoreKey() sdk.StoreKey
- func (k Keeper) WithBids(ctx sdk.Context, fn func(types.Bid) bool)
- func (k Keeper) WithBidsForOrder(ctx sdk.Context, id types.OrderID, fn func(types.Bid) bool)
- func (k Keeper) WithLeases(ctx sdk.Context, fn func(types.Lease) bool)
- func (k Keeper) WithOrders(ctx sdk.Context, fn func(types.Order) bool)
- func (k Keeper) WithOrdersForGroup(ctx sdk.Context, id dtypes.GroupID, fn func(types.Order) bool)
- type Querier
- func (k Querier) Bid(c context.Context, req *types.QueryBidRequest) (*types.QueryBidResponse, error)
- func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error)
- func (k Querier) Lease(c context.Context, req *types.QueryLeaseRequest) (*types.QueryLeaseResponse, error)
- func (k Querier) Leases(c context.Context, req *types.QueryLeasesRequest) (*types.QueryLeasesResponse, error)
- func (k Querier) Order(c context.Context, req *types.QueryOrderRequest) (*types.QueryOrderResponse, error)
- func (k Querier) Orders(c context.Context, req *types.QueryOrdersRequest) (*types.QueryOrdersResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EscrowKeeper ¶
type EscrowKeeper interface { GetAccount(ctx sdk.Context, id etypes.AccountID) (etypes.Account, error) GetPayment(ctx sdk.Context, id etypes.AccountID, pid string) (etypes.FractionalPayment, error) AccountClose(ctx sdk.Context, id etypes.AccountID) error PaymentClose(ctx sdk.Context, id etypes.AccountID, pid string) error }
type IKeeper ¶
type IKeeper interface { NewQuerier() Querier Codec() codec.BinaryCodec StoreKey() sdk.StoreKey CreateOrder(ctx sdk.Context, gid dtypes.GroupID, spec dtypes.GroupSpec) (types.Order, error) CreateBid(ctx sdk.Context, oid types.OrderID, provider sdk.AccAddress, price sdk.DecCoin) (types.Bid, error) CreateLease(ctx sdk.Context, bid types.Bid) OnOrderMatched(ctx sdk.Context, order types.Order) OnBidMatched(ctx sdk.Context, bid types.Bid) OnBidLost(ctx sdk.Context, bid types.Bid) OnBidClosed(ctx sdk.Context, bid types.Bid) OnOrderClosed(ctx sdk.Context, order types.Order) OnLeaseClosed(ctx sdk.Context, lease types.Lease, state types.Lease_State) OnGroupClosed(ctx sdk.Context, id dtypes.GroupID) GetOrder(ctx sdk.Context, id types.OrderID) (types.Order, bool) GetBid(ctx sdk.Context, id types.BidID) (types.Bid, bool) GetLease(ctx sdk.Context, id types.LeaseID) (types.Lease, bool) LeaseForOrder(ctx sdk.Context, oid types.OrderID) (types.Lease, bool) WithOrders(ctx sdk.Context, fn func(types.Order) bool) WithBids(ctx sdk.Context, fn func(types.Bid) bool) WithLeases(ctx sdk.Context, fn func(types.Lease) bool) WithOrdersForGroup(ctx sdk.Context, id dtypes.GroupID, fn func(types.Order) bool) WithBidsForOrder(ctx sdk.Context, id types.OrderID, fn func(types.Bid) bool) BidCountForOrder(ctx sdk.Context, id types.OrderID) uint32 GetParams(ctx sdk.Context) (params types.Params) SetParams(ctx sdk.Context, params types.Params) }
TODO: use interface for all keepers, queriers
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, skey sdk.StoreKey, pspace paramtypes.Subspace, ekeeper EscrowKeeper) IKeeper
NewKeeper creates and returns an instance for Market keeper
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the market store
func (Keeper) BidCountForOrder ¶
func (Keeper) CreateBid ¶
func (k Keeper) CreateBid(ctx sdk.Context, oid types.OrderID, provider sdk.AccAddress, price sdk.DecCoin) (types.Bid, error)
CreateBid creates a bid for a order with given orderID, price for bid and provider
func (Keeper) CreateLease ¶
CreateLease creates lease for bid with given bidID. Should only be called by the EndBlock handler or unit tests.
func (Keeper) CreateOrder ¶
func (k Keeper) CreateOrder(ctx sdk.Context, gid dtypes.GroupID, spec dtypes.GroupSpec) (types.Order, error)
CreateOrder creates a new order with given group id and specifications. It returns created order
func (Keeper) LeaseForOrder ¶
LeaseForOrder returns lease for order with given ID and lease found status
func (Keeper) NewQuerier ¶
func (Keeper) OnBidClosed ¶
OnBidClosed updates bid state to closed
func (Keeper) OnBidMatched ¶
OnBidActive updates bid state to matched
func (Keeper) OnGroupClosed ¶
OnGroupClosed updates state of all orders, bids and leases in group to closed
func (Keeper) OnLeaseClosed ¶
OnLeaseClosed updates lease state to closed
func (Keeper) OnOrderClosed ¶
OnOrderClosed updates order state to closed
func (Keeper) OnOrderMatched ¶
OnOrderMatched updates order state to matched
func (Keeper) WithBidsForOrder ¶
WithBidsForOrder iterates all bids of a order in market with given OrderID
func (Keeper) WithLeases ¶
WithLeases iterates all leases in market
func (Keeper) WithOrders ¶
WithOrders iterates all orders in market
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) Bid ¶
func (k Querier) Bid(c context.Context, req *types.QueryBidRequest) (*types.QueryBidResponse, error)
Bid returns bid details based on BidID
func (Querier) Bids ¶
func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error)
Bids returns bids based on filters
func (Querier) Lease ¶
func (k Querier) Lease(c context.Context, req *types.QueryLeaseRequest) (*types.QueryLeaseResponse, error)
Lease returns lease details based on LeaseID
func (Querier) Leases ¶
func (k Querier) Leases(c context.Context, req *types.QueryLeasesRequest) (*types.QueryLeasesResponse, error)
Leases returns leases based on filters
func (Querier) Order ¶
func (k Querier) Order(c context.Context, req *types.QueryOrderRequest) (*types.QueryOrderResponse, error)
Order returns order details based on OrderID
func (Querier) Orders ¶
func (k Querier) Orders(c context.Context, req *types.QueryOrdersRequest) (*types.QueryOrdersResponse, error)
Orders returns orders based on filters