MCPcopy
hub / github.com/thrasher-corp/gocryptotrader / stringToOrderStatus

Function stringToOrderStatus

exchanges/binance/binance_websocket.go:416–435  ·  view source on GitHub ↗
(status string)

Source from the content-addressed store, hash-verified

414}
415
416func stringToOrderStatus(status string) (order.Status, error) {
417 switch status {
418 case "NEW":
419 return order.New, nil
420 case "PARTIALLY_FILLED":
421 return order.PartiallyFilled, nil
422 case "FILLED":
423 return order.Filled, nil
424 case "CANCELED":
425 return order.Cancelled, nil
426 case "PENDING_CANCEL":
427 return order.PendingCancel, nil
428 case "REJECTED":
429 return order.Rejected, nil
430 case "EXPIRED":
431 return order.Expired, nil
432 default:
433 return order.UnknownStatus, errors.New(status + " not recognised as order status")
434 }
435}
436
437// SeedLocalCache seeds depth data
438func (e *Exchange) SeedLocalCache(ctx context.Context, p currency.Pair) error {

Callers 2

wsHandleDataMethod · 0.70

Calls 1

NewMethod · 0.80

Tested by 1