func (cl *ocxClient) AuctionOrderCommand(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 {
		err = fmt.Errorf("Error parsing amountHave, please enter something valid:\n%s", err)
		return
	}

	price, err := strconv.ParseFloat(args[3], 64)
	if err != nil {
		err = fmt.Errorf("Error parsing price: \n%s", err)
		return
	}

	var pubkey *koblitz.PublicKey
	if pubkey, err = cl.RetrievePublicKey(); err != nil {
		return
	}

	var paramreply *cxauctionrpc.GetPublicParametersReply
	if paramreply, err = cl.RPCClient.GetPublicParameters(); err != nil {
		err = fmt.Errorf("Error getting public parameters before placing auction order: %s", err)
		return
	}

	// we ignore reply because there's nothing in it and we don't use it
	// var reply *cxauctionrpc.SubmitPuzzledOrderReply
	if _, err = cl.RPCClient.AuctionOrderCommand(pubkey, side, pair, amountHave, price, paramreply.AuctionTime, paramreply.AuctionID); err != nil {
		return
	}

	logging.Infof("Successfully placed auction order")

	return
}
// OrderCommand submits an order (for now)
OrderCommand submits an order (for now)
// OrderCommand submits an order ( for now )
func (cl *ocxClient) AuctionOrderCommand(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 {
		err = fmt.Errorf("Error parsing amountHave, please enter something valid:\n%s", err)
		return
	}
	price, err := strconv.ParseFloat(args[3], 64)
	if err != nil {
		err = fmt.Errorf("Error parsing price: \n%s", err)
		return
	}
	var pubkey *koblitz.PublicKey
	if pubkey, err = cl.RetrievePublicKey(); err != nil {
		return
	}
	var paramreply *cxauctionrpc.GetPublicParametersReply
	if paramreply, err = cl.RPCClient.GetPublicParameters(); err != nil {
		err = fmt.Errorf("Error getting public parameters before placing auction order: %s", err)
		return
	}
	if _, err = cl.RPCClient.AuctionOrderCommand(pubkey, side, pair, amountHave, price, paramreply.AuctionTime, paramreply.AuctionID); err != nil {
		return
	}
	logging.Infof("Successfully placed auction order")
	return
}
func ( cl * ocxClient ) AuctionOrderCommand ( 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 { err = fmt . Errorf ( " \n " , err ) return } price , err := strconv . ParseFloat ( args [ 3 ] , 64 ) if err != nil { err = fmt . Errorf ( " \n " , err ) return } var pubkey * koblitz . PublicKey if pubkey , err = cl . RetrievePublicKey ( ) ; err != nil { return } var paramreply * cxauctionrpc . GetPublicParametersReply if paramreply , err = cl . RPCClient . GetPublicParameters ( ) ; err != nil { err = fmt . Errorf ( " " , err ) return } if _ , err = cl . RPCClient . AuctionOrderCommand ( pubkey , side , pair , amountHave , price , paramreply . AuctionTime , paramreply . AuctionID ) ; err != nil { return } logging . Infof ( " " ) return }
OrderCommand submits an order (for now)
OrderCommand submits an order ( for now )
// we ignore reply because there's nothing in it and we don't use it // var reply *cxauctionrpc.SubmitPuzzledOrderReply