mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 23:16:51 +00:00
orders: Add methods to derive SubmitResponse and Detail types (#955)
* orders: deprecate SubmitResponse return and change to *order.Detail construct detail from order.Submit struct * orders: add coverage, fix tests * coinut: rm test for checking * orders: revert change for return and change field ID to a more explicit name OrderID * orders: Add method to see if the order was placed * order: change field name in Cancel type to be more explicit * orders: standardize field -> OrderID * backtester: populate change * orders: add test * gctscript: fix field name * linter: fix issues * linter: more fixes * linter: forever * exchanges_tests: populate order.Submit field exchange name * Update exchanges/order/order_types.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * Update exchanges/order/orders.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * glorious: nits * glorious: nits * thrasher: nits Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
@@ -322,7 +322,7 @@ func ExchangeOrderQuery(args ...objects.Object) (objects.Object, error) {
|
||||
|
||||
data := make(map[string]objects.Object, 14)
|
||||
data["exchange"] = &objects.String{Value: orderDetails.Exchange}
|
||||
data["id"] = &objects.String{Value: orderDetails.ID}
|
||||
data["id"] = &objects.String{Value: orderDetails.OrderID}
|
||||
data["accountid"] = &objects.String{Value: orderDetails.AccountID}
|
||||
data["currencypair"] = &objects.String{Value: orderDetails.Pair.String()}
|
||||
data["price"] = &objects.Float{Value: orderDetails.Price}
|
||||
@@ -480,11 +480,7 @@ func ExchangeOrderSubmit(args ...objects.Object) (objects.Object, error) {
|
||||
|
||||
data := make(map[string]objects.Object, 2)
|
||||
data["orderid"] = &objects.String{Value: rtn.OrderID}
|
||||
if rtn.IsOrderPlaced {
|
||||
data["isorderplaced"] = objects.TrueValue
|
||||
} else {
|
||||
data["isorderplaced"] = objects.FalseValue
|
||||
}
|
||||
data["isorderplaced"] = objects.TrueValue
|
||||
|
||||
return &objects.Map{
|
||||
Value: data,
|
||||
|
||||
@@ -23,15 +23,10 @@ const (
|
||||
)
|
||||
|
||||
// Wrapper instance of GCT to use for modules
|
||||
var Wrapper GCT
|
||||
|
||||
// GCT interface requirements
|
||||
type GCT interface {
|
||||
Exchange
|
||||
}
|
||||
var Wrapper GCTExchange
|
||||
|
||||
// Exchange interface requirements
|
||||
type Exchange interface {
|
||||
type GCTExchange interface {
|
||||
Exchanges(enabledOnly bool) []string
|
||||
IsEnabled(exch string) bool
|
||||
Orderbook(ctx context.Context, exch string, pair currency.Pair, item asset.Item) (*orderbook.Base, error)
|
||||
@@ -48,6 +43,6 @@ type Exchange interface {
|
||||
}
|
||||
|
||||
// SetModuleWrapper link the wrapper and interface to use for modules
|
||||
func SetModuleWrapper(wrapper GCT) {
|
||||
func SetModuleWrapper(wrapper GCTExchange) {
|
||||
Wrapper = wrapper
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user