Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Id string Active bool LockedUntil time.Time Locked bool CashAvailable float64 CashAmount float64 CashReserved float64 CryptoAvailable float64 CryptoAmount float64 CryptoReserved float64 OperationStopLoss float64 DayStopLoss float64 MonthStopLoss float64 OperationAmountPercentage float64 BuyOn int SellOn int Symbols []string Summary []*Summary }
func (*Client) CreateOperation ¶
func (c *Client) CreateOperation(request *OperationRequest, coin *Coin) (*Operation, custom_error.BaseErrorAdapter)
CreateOperation validates if client current values can operate, then creates a model.Operation and also updates reserved balance as necessary for the operation. Will return error in case of validation failure.
func (*Client) SetBalance ¶
SetBalance will update client current balance, will take account of reserved values.
type Coin ¶
func (Coin) GetMinOperationValue ¶
func (c Coin) GetMinOperationValue(operationType operation_type.OperationType) float64
type Operation ¶
type Operation struct { Id string Status status.Status CreatedAt time.Time Locked bool Type operation_type.OperationType Amount float64 Base symbol.Symbol Quote symbol.Symbol StopLoss float64 }
func NewOperation ¶
type OperationRequest ¶
type OperationRequest struct { ClientId string Operation operation_type.OperationType Symbol symbol.Symbol StartTime time.Time }
type Summary ¶
type Summary struct { Type summary_type.SummaryType Day int Month int Year int AmountSold float64 AmountBought float64 Profit float64 }
Click to show internal directories.
Click to hide internal directories.