Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) Codec() codec.BinaryMarshaler
- func (k Keeper) CreateBid(ctx sdk.Context, oid types.OrderID, provider sdk.AccAddress, price sdk.Coin) (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) LeaseForOrder(ctx sdk.Context, oid types.OrderID) (types.Lease, bool)
- 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) OnInsufficientFunds(ctx sdk.Context, lease types.Lease)
- func (k Keeper) OnLeaseClosed(ctx sdk.Context, lease types.Lease)
- func (k Keeper) OnOrderClosed(ctx sdk.Context, order types.Order)
- func (k Keeper) OnOrderMatched(ctx sdk.Context, order types.Order)
- func (k Keeper) WithActiveLeases(ctx sdk.Context, fn func(types.Lease) bool)
- 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) WithOpenOrders(ctx sdk.Context, fn func(types.Order) 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 Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the market store
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryMarshaler, skey sdk.StoreKey) Keeper
NewKeeper creates and returns an instance for Market keeper
func (Keeper) CreateBid ¶
func (k Keeper) CreateBid(ctx sdk.Context, oid types.OrderID, provider sdk.AccAddress, price sdk.Coin) (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) OnBidClosed ¶
OnBidClosed updates bid state to closed
func (Keeper) OnBidMatched ¶
OnBidMatched updates bid state to matched
func (Keeper) OnGroupClosed ¶
OnGroupClosed updates state of all orders, bids and leases in group to closed
func (Keeper) OnInsufficientFunds ¶
OnInsufficientFunds updates lease state to insufficient funds
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) WithActiveLeases ¶ added in v0.7.5
WithActiveLeases iterates through all leases that were marked as Active and
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) WithOpenOrders ¶ added in v0.7.8
WithOpenOrders iterates all orders in market
func (Keeper) WithOrders ¶
WithOrders iterates all orders in market
type Querier ¶ added in v0.9.1
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 ¶ added in v0.9.1
func (k Querier) Bid(c context.Context, req *types.QueryBidRequest) (*types.QueryBidResponse, error)
Bid returns bid details based on BidID
func (Querier) Bids ¶ added in v0.9.1
func (k Querier) Bids(c context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error)
Bids returns bids based on filters
func (Querier) Lease ¶ added in v0.9.1
func (k Querier) Lease(c context.Context, req *types.QueryLeaseRequest) (*types.QueryLeaseResponse, error)
Lease returns lease details based on LeaseID
func (Querier) Leases ¶ added in v0.9.1
func (k Querier) Leases(c context.Context, req *types.QueryLeasesRequest) (*types.QueryLeasesResponse, error)
Leases returns leases based on filters
func (Querier) Order ¶ added in v0.9.1
func (k Querier) Order(c context.Context, req *types.QueryOrderRequest) (*types.QueryOrderResponse, error)
Order returns order details based on OrderID
func (Querier) Orders ¶ added in v0.9.1
func (k Querier) Orders(c context.Context, req *types.QueryOrdersRequest) (*types.QueryOrdersResponse, error)
Orders returns orders based on filters