Documentation ¶
Index ¶
- Variables
- func GetGratestDivisor(a sdk.Int, b sdk.Int) sdk.Int
- func KeyAddressOrders(addr sdk.AccAddress) []byte
- func KeyOrder(id uint64) []byte
- func ParamKeyTable() params.KeyTable
- type Keeper
- func (keeper Keeper) AddOrder(ctx sdk.Context, order types.Order)
- func (keeper Keeper) Cancel(ctx sdk.Context, id uint64, addr sdk.AccAddress) (amt sdk.Coin, err sdk.Error)
- func (keeper Keeper) GetAddressOrders(ctx sdk.Context, addr sdk.AccAddress) (idArr []uint64)
- func (keeper Keeper) GetFrozenFundByAddr(ctx sdk.Context, addr sdk.AccAddress) (fund sdk.Coins, err sdk.Error)
- func (keeper Keeper) GetOrder(ctx sdk.Context, id uint64) (*types.Order, sdk.Error)
- func (keeper Keeper) GetOrdersByAddr(ctx sdk.Context, addr sdk.AccAddress) (orders types.Orders, err sdk.Error)
- func (keeper Keeper) GetOrdersFiltered(ctx sdk.Context, seller sdk.AccAddress, supplyDenom string, targetDenom string, ...) []*types.Order
- func (keeper Keeper) HasOrder(ctx sdk.Context, id uint64) bool
- func (keeper Keeper) Make(ctx sdk.Context, seller sdk.AccAddress, supply sdk.Coin, target sdk.Coin) (order *types.Order, err sdk.Error)
- func (keeper Keeper) PeekCurrentOrderId(ctx sdk.Context) (id uint64, err sdk.Error)
- func (keeper Keeper) SetAddressOrders(ctx sdk.Context, addr sdk.AccAddress, idArr []uint64)
- func (keeper Keeper) SetInitialOrderId(ctx sdk.Context, id uint64) sdk.Error
- func (keeper Keeper) SetOrder(ctx sdk.Context, order types.Order)
- func (keeper Keeper) Take(ctx sdk.Context, id uint64, buyer sdk.AccAddress, val sdk.Coin) (supplyTurnover sdk.Coin, targetTurnover sdk.Coin, soldOut bool, err sdk.Error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ParamsStoreKeyExchangeParams = []byte("exchangeparams") // TODO: Find another way to implement this without using accounts, or find a cleaner way to implement it using accounts. FrozenCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("exchangeFrozenCoins"))) )
View Source
var ( KeyDelimiter = []byte(":") KeyNextOrderId = []byte("newOrderId") )
Functions ¶
func KeyAddressOrders ¶
func KeyAddressOrders(addr sdk.AccAddress) []byte
Key for getting all orders of a seller from the store
func ParamKeyTable ¶
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) GetAddressOrders ¶
func (Keeper) GetFrozenFundByAddr ¶
func (Keeper) GetOrdersByAddr ¶
func (Keeper) GetOrdersFiltered ¶ added in v0.5.0
func (keeper Keeper) GetOrdersFiltered(ctx sdk.Context, seller sdk.AccAddress, supplyDenom string, targetDenom string, numLatest uint64) []*types.Order
Get Order from store by OrderId seller will filter orders by creator supplyDenom will filter orders by supply token denom targetDenom will filter orders by target token denom numLatest will fetch a specified number of the most recent orders, or 0 for all orders
func (Keeper) PeekCurrentOrderId ¶
Peeks the next available id without incrementing it
func (Keeper) SetAddressOrders ¶ added in v0.5.0
func (Keeper) SetInitialOrderId ¶
Set the initial order ID
Click to show internal directories.
Click to hide internal directories.