// OrderCommand submits an order (for now)
OrderCommand submits an order (for now)
// OrderCommand submits an order ( for now )
func (cl *ocxClient) OrderCommand(args []string) (err error) {
	if err = cl.UnlockKey(); err != nil {
		logging.Fatalf("Could not unlock key! Fatal!")
	}
	side := args[0]
	pair := args[1]
	amountHave, err := strconv.ParseUint(args[2], 10, 64)
	if err != nil {
		return fmt.Errorf("Error parsing amountHave, please enter something valid:\n%s", err)
	}
	price, err := strconv.ParseFloat(args[3], 64)
	if err != nil {
		return fmt.Errorf("Error parsing price: \n%s", err)
	}
	var pubkey *koblitz.PublicKey
	if pubkey, err = cl.RetrievePublicKey(); err != nil {
		return
	}
	var reply *cxrpc.SubmitOrderReply
	if reply, err = cl.RPCClient.OrderCommand(pubkey, side, pair, amountHave, price); err != nil {
		return
	}
	logging.Infof("Submitted order successfully, orderID: %s", reply.OrderID)
	return nil
}
func ( cl * ocxClient ) OrderCommand ( args [ ] string ) ( err error ) { if err = cl . UnlockKey ( ) ; err != nil { logging . Fatalf ( " " ) } side := args [ 0 ] pair := args [ 1 ] amountHave , err := strconv . ParseUint ( args [ 2 ] , 10 , 64 ) if err != nil { return fmt . Errorf ( " \n " , err ) } price , err := strconv . ParseFloat ( args [ 3 ] , 64 ) if err != nil { return fmt . Errorf ( " \n " , err ) } var pubkey * koblitz . PublicKey if pubkey , err = cl . RetrievePublicKey ( ) ; err != nil { return } var reply * cxrpc . SubmitOrderReply if reply , err = cl . RPCClient . OrderCommand ( pubkey , side , pair , amountHave , price ) ; err != nil { return } logging . Infof ( " " , reply . OrderID ) return nil }
OrderCommand submits an order (for now)
OrderCommand submits an order ( for now )