// CreateOrder creates an order to buy or sell in a market of CryptoMarket
// Returns an Order struct that supports Close() and Refresh() to cancel or update
// the order respectively.
//
// List of accepted Arguments:
//   - required: Amount (string), Market (string), Price (string), Type (string)
//   - optional: none
// https://developers.cryptomkt.com/#crear-orden
CreateOrder creates an order to buy or sell in a market of CryptoMarket
Returns an Order struct that supports Close() and Refresh() to cancel or update
the order respectively.


// CreateOrder creates an order to buy or sell in a market of CryptoMarket // Returns an Order struct that supports Close () and Refresh () to cancel or update // the order respectively . // // List of accepted Arguments : // - required : Amount ( string ) Market ( string ) Price ( string ) Type ( string ) // - optional : none // https : // developers . cryptomkt . com / #crear - orden
func (client *Client) CreateOrder(arguments ...args.Argument) (*Order, error) {
	required := []string{"amount", "market", "price", "type"}
	resp, err := client.postReq("orders/create", "CreateOrder", required, arguments...)
	if err != nil {
		return nil, fmt.Errorf("error making the request: %s", err)
	}
	var oResp OrderResponse
	json.Unmarshal(resp, &oResp)
	if oResp.Status == "error" {
		return nil, fmt.Errorf("error from the server side: %s", oResp.Message)
	}
	oResp.Data.client = client
	return &oResp.Data, nil
}
func ( client * Client ) CreateOrder ( arguments ... args . Argument ) ( * Order , error ) { required := [ ] string { " " , " " , " " , " " } resp , err := client . postReq ( " " , " " , required , arguments ... ) if err != nil { return nil , fmt . Errorf ( " " , err ) } var oResp OrderResponse json . Unmarshal ( resp , & oResp ) if oResp . Status == " " { return nil , fmt . Errorf ( " " , oResp . Message ) } oResp . Data . client = client return & oResp . Data , nil }
CreateOrder creates an order to buy or sell in a market of CryptoMarket
Returns an Order struct that supports Close() and Refresh() to cancel or update
the order respectively.
CreateOrder creates an order to buy or sell in a market of CryptoMarket Returns an Order struct that supports Close () and Refresh () to cancel or update the order respectively .