Skip to content

Commit

Permalink
Merge pull request ethereum#492 from ngtuna/matching-engine-helper
Browse files Browse the repository at this point in the history
matching engine helper
  • Loading branch information
ngtuna authored Apr 18, 2019
2 parents e16a641 + 51de414 commit 36b960f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tomox/tomox.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ type TomoX struct {
statsMu sync.Mutex // guard stats

settings syncmap.Map // holds configuration settings that can be dynamically changed

}

func New(cfg *Config) *TomoX {
Expand Down Expand Up @@ -643,3 +642,19 @@ func (tomox *TomoX) CancelOrder(order *OrderItem) error {

return err
}

func (tomox *TomoX) GetBidsTree(pairName string) (*OrderTree, error) {
ob, err := tomox.GetOrderBook(pairName)
if err != nil {
return nil, err
}
return ob.Bids, nil
}

func (tomox *TomoX) GetAsksTree(pairName string) (*OrderTree, error) {
ob, err := tomox.GetOrderBook(pairName)
if err != nil {
return nil, err
}
return ob.Asks, nil
}

0 comments on commit 36b960f

Please sign in to comment.