Flow 8.4 list trading working
This commit is contained in:
@ -1,10 +1,5 @@
|
||||
package rest
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type HTTPError struct {
|
||||
Error string
|
||||
@ -23,26 +18,3 @@ type Session struct {
|
||||
Email string
|
||||
}
|
||||
|
||||
type QuoteRequest struct {
|
||||
ClOrdID string `json:"cl_ord_id" binding:"required"`
|
||||
QuoteID string `json:"quote_id" binding:"required"`
|
||||
Symbol string `json:"symbol" binding:"required"`
|
||||
Currency string `json:"currency"`
|
||||
BidPx string `json:"bid_px" binding:"required"`
|
||||
OfferPx string `json:"offer_px" binding:"required"`
|
||||
SecurityIDSource string `json:"security_id_source" binding:"required"`
|
||||
}
|
||||
|
||||
func (r QuoteRequest) toDecimals() (bidPx, offerPx, bidSize, offerSize decimal.Decimal, err error) {
|
||||
bidPx, err = decimal.NewFromString(r.BidPx)
|
||||
if err != nil {
|
||||
return bidPx, offerPx, bidSize, offerSize, fmt.Errorf("invalid bid_px: %w", err)
|
||||
}
|
||||
|
||||
offerPx, err = decimal.NewFromString(r.OfferPx)
|
||||
if err != nil {
|
||||
return bidPx, offerPx, bidSize, offerSize, fmt.Errorf("invalid offer_px: %w", err)
|
||||
}
|
||||
|
||||
return bidPx, offerPx, bidSize, offerSize, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user