Documentation ¶
Index ¶
- Variables
- func IsInvalidFillStatus(status types.OrderStatus) bool
- func IsPendingStatus(status types.OrderStatus) bool
- type CutoffCache
- func (c *CutoffCache) GetCutoff(protocol, owner common.Address) *big.Int
- func (c *CutoffCache) GetCutoffPair(protocol, owner, token1, token2 common.Address) *big.Int
- func (c *CutoffCache) IsOrderCutoff(protocol, owner, token1, token2 common.Address, validsince *big.Int) bool
- func (c *CutoffCache) UpdateCutoff(protocol, owner common.Address, cutoff *big.Int) error
- func (c *CutoffCache) UpdateCutoffPair(protocol, owner, token1, token2 common.Address, cutoff *big.Int) error
- type OrderManagerOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidFillStatus = []types.OrderStatus{ types.ORDER_UNKNOWN, types.ORDER_CUTOFF, types.ORDER_FINISHED, }
orderfilled 当用户处于ing状态时允许重置状态,cancel是特例,从合约的角度来看没有cancel,从客户端来看需要考虑cancel,这里我们以合约为准
View Source
var PendingStatus = []types.OrderStatus{ types.ORDER_PENDING, types.ORDER_CANCELLING, types.ORDER_CUTOFFING, }
View Source
var ValidCutoffStatus = []types.OrderStatus{ types.ORDER_NEW, types.ORDER_PARTIAL, types.ORDER_PENDING, types.ORDER_CANCELLING, types.ORDER_CUTOFFING, }
同一个订单必须允许多次cancel&cutoff,有的cancel/cutoff可能会不成功,后续的动作可以跟进
View Source
var ValidFlexCancelStatus = []types.OrderStatus{ types.ORDER_NEW, types.ORDER_PARTIAL, types.ORDER_PENDING, }
todo pending状态的订单是否允许软取消
View Source
var ValidMinerStatus = []types.OrderStatus{ types.ORDER_NEW, types.ORDER_PARTIAL, types.ORDER_PENDING, }
Functions ¶
func IsInvalidFillStatus ¶
func IsInvalidFillStatus(status types.OrderStatus) bool
func IsPendingStatus ¶
func IsPendingStatus(status types.OrderStatus) bool
Types ¶
type CutoffCache ¶
type CutoffCache struct {
// contains filtered or unexported fields
}
func NewCutoffCache ¶
func NewCutoffCache(expire int64) *CutoffCache
func (*CutoffCache) GetCutoff ¶
func (c *CutoffCache) GetCutoff(protocol, owner common.Address) *big.Int
func (*CutoffCache) GetCutoffPair ¶
func (c *CutoffCache) GetCutoffPair(protocol, owner, token1, token2 common.Address) *big.Int
func (*CutoffCache) IsOrderCutoff ¶
func (c *CutoffCache) IsOrderCutoff(protocol, owner, token1, token2 common.Address, validsince *big.Int) bool
合约验证的是创建时间
func (*CutoffCache) UpdateCutoff ¶
func (*CutoffCache) UpdateCutoffPair ¶
type OrderManagerOptions ¶
Click to show internal directories.
Click to hide internal directories.