Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasicResponse ¶
type BasicResponse struct { Order Order `json:"order"` OrderDetails Details `json:"details,omitempty"` Success bool `json:"success"` Err string `json:"err,omitempty"` }
func (*BasicResponse) GetError ¶
func (br *BasicResponse) GetError() string
func (*BasicResponse) IsSuccess ¶
func (br *BasicResponse) IsSuccess() bool
type ProspectOrder ¶
type ProspectOrder struct { ValuableID string `json:"stock_id"` PortfolioID string `json:"portfolio"` ExchangeID string `json:"-"` Amount int64 `json:"amount"` ResponseChannel chan Response `json:"-"` }
func MakeProspect ¶
func MakeProspect(valuableID, portfolioUUID string, amount int64) *ProspectOrder
type TradeOrder ¶
type TradeOrder struct { ValuableID string `json:"stock_id"` PortfolioID string `json:"portfolio"` ExchangeID string `json:"-"` Amount int64 `json:"amount"` ResponseChannel chan Response `json:"-"` }
* Purchase order represents a single order
func MakePurchaseOrder ¶
func MakePurchaseOrder(valuableID, portfolioUUID string, amount int64) *TradeOrder
note this does not validate if the stock exists or not, that's done in the trade() function
type TradeOrderHistory ¶
type TransferOrder ¶
type TransferOrder struct { ReceiverID string `json:"receiver"` PortfolioID string `json:"giver"` Amount int64 `json:"amount"` ResponseChannel chan Response `json:"-"` }
func MakeTransferOrder ¶
func MakeTransferOrder(giver, receiver string, amount int64) *TransferOrder
Click to show internal directories.
Click to hide internal directories.