// Close closes the calling order, and changes the order to reflect
// the new state of the order, after being closed.
// Calls CancelOrder with the asociated client of the order.
// https://developers.cryptomkt.com/es/#cancelar-una-orden
Close closes the calling order, and changes the order to reflect
the new state of the order, after being closed.
Calls CancelOrder with the asociated client of the order.
// Close closes the calling order and changes the order to reflect // the new state of the order after being closed . // Calls CancelOrder with the asociated client of the order . // https : // developers . cryptomkt . com / es / #cancelar - una - orden
func (o *Order) Close() (*Order, error) {
	oClosed, err := o.client.CancelOrder(args.Id(o.Id))
	if err != nil {
		return nil, fmt.Errorf("Close order %s failed: %s", o.Id, err)
	}
	oClosed.client = o.client
	return oClosed, nil
}
func ( o * Order ) Close ( ) ( * Order , error ) { oClosed , err := o . client . CancelOrder ( args . Id ( o . Id ) ) if err != nil { return nil , fmt . Errorf ( " " , o . Id , err ) } oClosed . client = o . client return oClosed , nil }
Close closes the calling order, and changes the order to reflect
the new state of the order, after being closed.
Close closes the calling order and changes the order to reflect the new state of the order after being closed .